Skip to content

Commit

Permalink
Adjust test_squeeze for relaxed stride checking
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 12, 2016
1 parent b30bb66 commit 25556f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_gpuarray.py
Expand Up @@ -805,25 +805,25 @@ def test_squeeze(self):
# 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 25556f4

Please sign in to comment.