MCPcopy Index your code
hub / github.com/numpy/numpy / testFloor

Method testFloor

tools/swig/test/testSuperTensor.py:180–190  ·  view source on GitHub ↗

Test floor function

(self)

Source from the content-addressed store, hash-verified

178
179 # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
180 def testFloor(self):
181 "Test floor function"
182 print(self.typeStr, "... ", file=sys.stderr)
183 supertensor = np.arange(2 * 2 * 2 * 2,
184 dtype=self.typeCode).reshape((2, 2, 2, 2))
185 answer = supertensor.copy()
186 answer[answer < 4] = 4
187
188 floor = SuperTensor.__dict__[self.typeStr + "Floor"]
189 floor(supertensor, 4)
190 np.testing.assert_array_equal(supertensor, answer)
191
192 # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
193 def testFloorWrongType(self):

Callers

nothing calls this directly

Calls 2

reshapeMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected