Test ceil function
(self)
| 214 | |
| 215 | # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap |
| 216 | def testCeil(self): |
| 217 | "Test ceil function" |
| 218 | print(self.typeStr, "... ", file=sys.stderr) |
| 219 | supertensor = np.arange(2 * 2 * 2 * 2, |
| 220 | dtype=self.typeCode).reshape((2, 2, 2, 2)) |
| 221 | answer = supertensor.copy() |
| 222 | answer[answer > 5] = 5 |
| 223 | ceil = SuperTensor.__dict__[self.typeStr + "Ceil"] |
| 224 | ceil(supertensor, 5) |
| 225 | np.testing.assert_array_equal(supertensor, answer) |
| 226 | |
| 227 | # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap |
| 228 | def testCeilWrongType(self): |