Skip to content

Commit

Permalink
delete C_CONTIGUOUS assertions to be compatible with particular build…
Browse files Browse the repository at this point in the history
…s of numpy
  • Loading branch information
soumith committed Aug 8, 2019
1 parent 6406912 commit 8554416
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions test/test_torch.py
Expand Up @@ -8892,7 +8892,6 @@ def check_single_matmul(self, x, y, shape):
a = np.array(x, copy=False)
b = np.array(y, copy=False)
expected = np.matmul(a, b)
self.assertTrue(expected.flags['C_CONTIGUOUS'])

ans = torch.matmul(x, y)
self.assertTrue(ans.is_contiguous())
Expand Down Expand Up @@ -11170,21 +11169,18 @@ def check2d(x, y):
x = get_castable_tensor((sz1, sz2), tp)
y = x.numpy()
check2d(x, y)
self.assertTrue(y.flags['C_CONTIGUOUS'])

# with storage offset
xm = get_castable_tensor((sz1 * 2, sz2), tp)
x = xm.narrow(0, sz1 - 1, sz1)
y = x.numpy()
self.assertTrue(x.storage_offset() > 0)
check2d(x, y)
self.assertTrue(y.flags['C_CONTIGUOUS'])

# non-contiguous 2D
x = get_castable_tensor((sz2, sz1), tp).t()
y = x.numpy()
check2d(x, y)
self.assertFalse(y.flags['C_CONTIGUOUS'])

# with storage offset
xm = get_castable_tensor((sz2 * 2, sz1), tp)
Expand Down

0 comments on commit 8554416

Please sign in to comment.