def test_Erf1D_double(self): npr = temp_erf(self.np_double_a) dcr = dc.erf(self.dc_double_a) np.testing.assert_allclose(npr, np.array(dcr.data()).astype(np.float64), rtol=1e-3, atol=1e-3)
def test_Erf2D_double_1(self): np_double_a = np.reshape(self.np_double_a, (3, 16)) dc_double_a = dc.reshape(self.dc_double_a, (3, 16)) npr = temp_erf(np_double_a) dcr = dc.erf(dc_double_a) np.testing.assert_allclose(npr.flatten(), np.array(dcr.data()).astype(np.float64), rtol=1e-3, atol=1e-3)
def test_Erf2D_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 = temp_erf(np_float_a) dcr = dc.erf(dc_float_a) np.testing.assert_allclose(npr.flatten(), np.array(dcr.data()).astype(np.float32), rtol=1e-3, atol=1e-3)
def test_nnScalar_erf (self): np.testing.assert_allclose(temp_erf(self.random_number1), dc.erf(self.random_number1), rtol=1e-3, atol=1e-3) np.testing.assert_allclose(temp_erf(self.random_number2), dc.erf(self.random_number2), rtol=1e-3, atol=1e-3) np.testing.assert_allclose(temp_erf(self.random_number3), dc.erf(self.random_number3), rtol=1e-3, atol=1e-3)