Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dario Coscia authored and Dario Coscia committed Oct 31, 2023
1 parent 8bff3e9 commit 84aaf7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_label_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def test_getitem():
assert tensor_view.labels == ['a']
assert torch.allclose(tensor_view.flatten(), data[:, 0])

tensor_view = tensor['a', 'c']

assert tensor_view.labels == ['a', 'c']
assert torch.allclose(tensor_view, data[:, 0::2])

def test_getitem2():
tensor = LabelTensor(data, labels)
tensor_view = tensor[:5]
Expand Down

0 comments on commit 84aaf7b

Please sign in to comment.