Test scale function
(self)
| 124 | |
| 125 | # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap |
| 126 | def testScale(self): |
| 127 | "Test scale function" |
| 128 | print(self.typeStr, "... ", file=sys.stderr) |
| 129 | scale = SuperTensor.__dict__[self.typeStr + "Scale"] |
| 130 | supertensor = np.arange(3*3*3*3, dtype=self.typeCode).reshape((3, 3, 3, 3)) |
| 131 | answer = supertensor.copy()*4 |
| 132 | scale(supertensor, 4) |
| 133 | self.assertEqual((supertensor == answer).all(), True) |
| 134 | |
| 135 | # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap |
| 136 | def testScaleWrongType(self): |