Test scale function
(self)
| 131 | |
| 132 | # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap |
| 133 | def testScale(self): |
| 134 | "Test scale function" |
| 135 | print(self.typeStr, "... ", file=sys.stderr) |
| 136 | scale = SuperTensor.__dict__[self.typeStr + "Scale"] |
| 137 | supertensor = np.arange(3 * 3 * 3 * 3, |
| 138 | dtype=self.typeCode).reshape((3, 3, 3, 3)) |
| 139 | answer = supertensor.copy() * 4 |
| 140 | scale(supertensor, 4) |
| 141 | self.assertEqual((supertensor == answer).all(), True) |
| 142 | |
| 143 | # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap |
| 144 | def testScaleWrongType(self): |