MCPcopy Create free account
hub / github.com/numpy/numpy / testNorm

Method testNorm

tools/swig/test/testTensor.py:26–35  ·  view source on GitHub ↗

Test norm function

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

printFunction · 0.85
normFunction · 0.85

Tested by

no test coverage detected