def test_Log1D(self): npr = np.log(self.np_a) dcr = dc.log(self.dc_a) np.testing.assert_allclose(npr, np.array(dcr.data()).astype(np.float32), rtol=1e-3, atol=1e-3)
def test_Log2D (self): np_a = np.reshape(self.np_a, (6,4)) dc_a = dc.reshape(self.dc_a, (6,4)); npr = np.log(np_a); dcr = dc.log(dc_a); np.testing.assert_allclose(npr.flatten(), np.array(dcr.data()).astype(np.float32), rtol=1e-3, atol=1e-3)