Skip to content

Commit 8554416

Browse files
committed
delete C_CONTIGUOUS assertions to be compatible with particular builds of numpy
1 parent 6406912 commit 8554416

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

test/test_torch.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8892,7 +8892,6 @@ def check_single_matmul(self, x, y, shape):
88928892
a = np.array(x, copy=False)
88938893
b = np.array(y, copy=False)
88948894
expected = np.matmul(a, b)
8895-
self.assertTrue(expected.flags['C_CONTIGUOUS'])
88968895

88978896
ans = torch.matmul(x, y)
88988897
self.assertTrue(ans.is_contiguous())
@@ -11170,21 +11169,18 @@ def check2d(x, y):
1117011169
x = get_castable_tensor((sz1, sz2), tp)
1117111170
y = x.numpy()
1117211171
check2d(x, y)
11173-
self.assertTrue(y.flags['C_CONTIGUOUS'])
1117411172

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

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

1118911185
# with storage offset
1119011186
xm = get_castable_tensor((sz2 * 2, sz1), tp)

0 commit comments

Comments
 (0)