def test_Floor1D_double(self): npr = np.floor(self.np_double_a) dcr = dc.floor(self.dc_double_a) np.testing.assert_allclose(npr, np.array(dcr.data()).astype(np.float64), rtol=1e-3, atol=1e-3)
def test_Floor2D_double_2(self): np_double_a = np.reshape(self.np_double_a, (6, 8)) dc_double_a = dc.reshape(self.dc_double_a, (6, 8)) npr = np.floor(np_double_a) dcr = dc.floor(dc_double_a) np.testing.assert_allclose(npr.flatten(), np.array(dcr.data()).astype(np.float64), rtol=1e-3, atol=1e-3)
def test_Floor2D_float_3(self): np_float_a = np.reshape(self.np_float_a, (12, 4)) dc_float_a = dc.reshape(self.dc_float_a, (12, 4)) npr = np.floor(np_float_a) dcr = dc.floor(dc_float_a) np.testing.assert_allclose(npr.flatten(), np.array(dcr.data()).astype(np.float32), rtol=1e-3, atol=1e-3)