Skip to content

Commit

Permalink
Adjust test_squeeze for relaxsed stride checking
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 12, 2016
1 parent 1b80338 commit 63f6fff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_array.py
Expand Up @@ -980,25 +980,25 @@ def test_squeeze(ctx_factory):
# Slice with length 1 on dimensions 0 and 1
a_gpu_slice = a_gpu[0:1, 1:2, :, :]
assert a_gpu_slice.shape == (1, 1, shape[2], shape[3])
assert a_gpu_slice.flags.c_contiguous is False
assert a_gpu_slice.flags.c_contiguous

# Squeeze it and obtain contiguity
a_gpu_squeezed_slice = a_gpu[0:1, 1:2, :, :].squeeze()
assert a_gpu_squeezed_slice.shape == (shape[2], shape[3])
assert a_gpu_squeezed_slice.flags.c_contiguous is True
assert a_gpu_squeezed_slice.flags.c_contiguous

# Check that we get the original values out
#assert np.all(a_gpu_slice.get().ravel() == a_gpu_squeezed_slice.get().ravel())

# Slice with length 1 on dimensions 2
a_gpu_slice = a_gpu[:, :, 2:3, :]
assert a_gpu_slice.shape == (shape[0], shape[1], 1, shape[3])
assert a_gpu_slice.flags.c_contiguous is False
assert not a_gpu_slice.flags.c_contiguous

# Squeeze it, but no contiguity here
a_gpu_squeezed_slice = a_gpu[:, :, 2:3, :].squeeze()
assert a_gpu_squeezed_slice.shape == (shape[0], shape[1], shape[3])
assert a_gpu_squeezed_slice.flags.c_contiguous is False
assert not a_gpu_squeezed_slice.flags.c_contiguous

# Check that we get the original values out
#assert np.all(a_gpu_slice.get().ravel() == a_gpu_squeezed_slice.get().ravel())
Expand Down

0 comments on commit 63f6fff

Please sign in to comment.