MCPcopy
hub / github.com/numpy/numpy / testCeil

Method testCeil

tools/swig/test/testSuperTensor.py:216–225  ·  view source on GitHub ↗

Test ceil function

(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 2

reshapeMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected