Skip to content

Commit 2240211

Browse files
committed
BUG: fix triu_indices
1 parent 23c2bf3 commit 2240211

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

torch_np/_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ def tril_indices(n, k=0, m=None):
772772
def triu_indices(n, k=0, m=None):
773773
if m is None:
774774
m = n
775-
tensor_2 = torch.tril_indices(n, m, offset=k)
775+
tensor_2 = torch.triu_indices(n, m, offset=k)
776776
return tuple(asarray(_) for _ in tensor_2)
777777

778778

torch_np/tests/numpy_tests/lib/test_twodim_base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ def test_mask_indices():
365365
assert_array_equal(a[iu1], array([1, 2, 5]))
366366

367367

368-
@pytest.mark.xfail(reason="TODO: fancy indexing")
369368
def test_tril_indices():
370369
# indices without and with offset
371370
il1 = tril_indices(4)
@@ -413,7 +412,6 @@ def test_tril_indices():
413412
[-10, -10, -10, -10, -10]]))
414413

415414

416-
@pytest.mark.xfail(reason="TODO: fancy indexing")
417415
class TestTriuIndices:
418416
def test_triu_indices(self):
419417
iu1 = triu_indices(4)

0 commit comments

Comments
 (0)