def testViewDataOnMoveaxis(self): a = ones((10, 20), chunk_size=6) b = moveaxis(a, 1, 0) a[0][1] = 10 npa = np.ones((10, 20)) npb = np.moveaxis(npa, 1, 0) npa[0][1] = 10 np.testing.assert_array_equal(b.execute(), npb) np.testing.assert_array_equal(a.execute(), npa)
def testViewDataOnMoveaxis(self): data = np.random.rand(10, 20) a = tensor(data, chunk_size=6) b = moveaxis(a, 1, 0) a[0][1] = 10 npa = data.copy() npb = np.moveaxis(npa, 1, 0) npa[0][1] = 10 np.testing.assert_array_equal(b.execute(), npb) np.testing.assert_array_equal(a.execute(), npa)