Test norm function
(self)
| 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): |