MCPcopy
hub / github.com/numpy/numpy / testNorm

Method testNorm

tools/swig/test/testTensor.py:27–36  ·  view source on GitHub ↗

Test norm function

(self)

Source from the content-addressed store, hash-verified

25
26 # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap
27 def testNorm(self):
28 "Test norm function"
29 print(self.typeStr, "... ", end=' ', file=sys.stderr)
30 norm = Tensor.__dict__[self.typeStr + "Norm"]
31 tensor = [[[0, 1], [2, 3]],
32 [[3, 2], [1, 0]]]
33 if isinstance(self.result, int):
34 self.assertEqual(norm(tensor), self.result)
35 else:
36 self.assertAlmostEqual(norm(tensor), self.result, 6)
37
38 # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap
39 def testNormBadList(self):

Callers

nothing calls this directly

Calls 1

normFunction · 0.85

Tested by

no test coverage detected