Skip to content

Commit df66415

Browse files
committed
MAINT: address review comments
1 parent 679e053 commit df66415

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

torch_np/_detail/_flips.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ def swapaxes(tensor, axis1, axis2):
3232
return torch.swapaxes(tensor, axis1, axis2)
3333

3434

35+
# Straight vendor from:
3536
# https://github.com/numpy/numpy/blob/v1.24.0/numpy/core/numeric.py#L1259
37+
#
38+
# Also note this function in NumPy is mostly retained for backwards compat
39+
# (https://stackoverflow.com/questions/29891583/reason-why-numpy-rollaxis-is-so-confusing)
40+
# so let's not touch it unless hard pressed.
3641
def rollaxis(tensor, axis, start=0):
3742
n = tensor.ndim
3843
axis = _util.normalize_axis_index(axis, n)

torch_np/tests/numpy_tests/lib/test_function_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_axes(self):
130130
assert_raises(np.AxisError, np.flip, np.ones((4, 4)), axis=-3)
131131
assert_raises(np.AxisError, np.flip, np.ones((4, 4)), axis=(0, 3))
132132

133-
@pytest.mark.xfail(reason='no [::-1] indexing')
133+
@pytest.mark.skip(reason='no [::-1] indexing')
134134
def test_basic_lr(self):
135135
a = get_mat(4)
136136
b = a[:, ::-1]
@@ -141,7 +141,7 @@ def test_basic_lr(self):
141141
[5, 4, 3]]
142142
assert_equal(np.flip(a, 1), b)
143143

144-
@pytest.mark.xfail(reason='no [::-1] indexing')
144+
@pytest.mark.skip(reason='no [::-1] indexing')
145145
def test_basic_ud(self):
146146
a = get_mat(4)
147147
b = a[::-1, :]

0 commit comments

Comments
 (0)