add test_numpy_scalar_slice

This commit is contained in:
Dun Liang 2020-12-15 11:35:48 +08:00
parent 5c243bef79
commit 60da0179a9
1 changed files with 5 additions and 0 deletions

View File

@ -140,6 +140,11 @@ class TestSlice(unittest.TestCase):
a[c] = 0
assert (a.data == [1,2,3,0,0]).all()
def test_numpy_scalar_slice(self):
a = jt.random((2,2))
b = np.array([1])[0]
assert a[b].shape == [2]
if __name__ == "__main__":