Skip to content

Commit 10a8ccf

Browse files
killeentsoumith
authored andcommitted
only test gets for advanced indexing with duplicates (pytorch#2041)
1 parent 0a9e8a2 commit 10a8ccf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/test_torch.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,16 +2823,18 @@ def get_set_tensor(indexed, indexer):
28232823
# first, third rows,
28242824
[[0, 2], slice(None)],
28252825

2826-
# dupes
2827-
[slice(None), [0, 1, 1, 2, 2]],
2828-
28292826
# weird shape
28302827
[slice(None), [[0, 1],
28312828
[2, 3]]]
28322829
]
28332830

2834-
for indexer in indices_to_test:
2831+
# only test dupes on gets
2832+
get_indices_to_test = indices_to_test + [[slice(None), [0, 1, 1, 2, 2]]]
2833+
2834+
for indexer in get_indices_to_test:
28352835
assert_get_eq(reference, indexer)
2836+
2837+
for indexer in indices_to_test:
28362838
assert_set_eq(reference, indexer, 44)
28372839
assert_set_eq(reference,
28382840
indexer,

0 commit comments

Comments
 (0)