def test_Equal2D_double(self): np_double_a = np.reshape(self.np_double_a, (6, 8)) np_double_b = np.reshape(self.np_double_b, (6, 8)) dc_double_a = dc.reshape(self.dc_double_a, (6, 8)) dc_double_b = dc.reshape(self.dc_double_b, (6, 8)) npr = np.equal(np_double_a, np_double_b) dcr = dc.equal(dc_double_a, dc_double_b) np.testing.assert_array_equal(npr.flatten(), np.array(dcr.data()))
def test_Equal4D_float(self): np_float_a = np.reshape(self.np_float_a, (4, 2, 2, 3)) np_float_b = np.reshape(self.np_float_b, (4, 2, 2, 3)) dc_float_a = dc.reshape(self.dc_float_a, (4, 2, 2, 3)) dc_float_b = dc.reshape(self.dc_float_b, (4, 2, 2, 3)) npr = np.equal(np_float_a, np_float_b) dcr = dc.equal(dc_float_a, dc_float_b) np.testing.assert_array_equal(npr.flatten(), np.array(dcr.data()))
def test_Equal3D_bool(self): np_bool_a = np.reshape(self.np_bool_a, (4, 4, 3)) np_bool_b = np.reshape(self.np_bool_b, (4, 4, 3)) dc_bool_a = dc.reshape(self.dc_bool_a, (4, 4, 3)) dc_bool_b = dc.reshape(self.dc_bool_b, (4, 4, 3)) npr = np.equal(np_bool_a, np_bool_b) dcr = dc.equal(dc_bool_a, dc_bool_b) np.testing.assert_array_equal(npr.flatten(), np.array(dcr.data()))
def test_Equal1D_double(self): npr = np.equal(self.np_double_a, self.np_double_b) dcr = dc.equal(self.dc_double_a, self.dc_double_b) np.testing.assert_array_equal(npr, np.array(dcr.data()))
def test_Equal1D_float(self): npr = np.equal(self.np_float_a, self.np_float_b) dcr = dc.equal(self.dc_float_a, self.dc_float_b) np.testing.assert_array_equal(npr, np.array(dcr.data()))