MCPcopy Create free account
hub / github.com/numpy/numpy / testCeil

Method testCeil

tools/swig/test/testSuperTensor.py:207–215  ·  view source on GitHub ↗

Test ceil function

(self)

Source from the content-addressed store, hash-verified

205
206 # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap
207 def testCeil(self):
208 "Test ceil function"
209 print(self.typeStr, "... ", file=sys.stderr)
210 supertensor = np.arange(2*2*2*2, dtype=self.typeCode).reshape((2, 2, 2, 2))
211 answer = supertensor.copy()
212 answer[answer > 5] = 5
213 ceil = SuperTensor.__dict__[self.typeStr + "Ceil"]
214 ceil(supertensor, 5)
215 np.testing.assert_array_equal(supertensor, answer)
216
217 # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap
218 def testCeilWrongType(self):

Callers

nothing calls this directly

Calls 5

printFunction · 0.85
ceilFunction · 0.85
reshapeMethod · 0.80
assert_array_equalMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected