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

Method testFloor

tools/swig/test/testSuperTensor.py:172–181  ·  view source on GitHub ↗

Test floor function

(self)

Source from the content-addressed store, hash-verified

170
171 # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
172 def testFloor(self):
173 "Test floor function"
174 print(self.typeStr, "... ", file=sys.stderr)
175 supertensor = np.arange(2*2*2*2, dtype=self.typeCode).reshape((2, 2, 2, 2))
176 answer = supertensor.copy()
177 answer[answer < 4] = 4
178
179 floor = SuperTensor.__dict__[self.typeStr + "Floor"]
180 floor(supertensor, 4)
181 np.testing.assert_array_equal(supertensor, answer)
182
183 # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
184 def testFloorWrongType(self):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected