Skip to content

Commit

Permalink
Merge pull request #465 from NickleDave/fix-test-functional-fixes-#464
Browse files Browse the repository at this point in the history
Fix `test_functional`, fixes #464
  • Loading branch information
NickleDave committed Mar 14, 2022
2 parents f340542 + 9c04459 commit 4599740
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_nn/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_onehot():
# convert labels to one hot tensor
one_hot = F.one_hot(labels, num_classes)

assert pytest.approx(one_hot[0, labels[0, 0, 0], 0, 0].item(), 1.0)
assert pytest.approx(one_hot[0, labels[0, 1, 0], 1, 0].item(), 1.0)
assert pytest.approx(one_hot[1, labels[1, 0, 0], 0, 0].item(), 1.0)
assert pytest.approx(one_hot[1, labels[1, 1, 0], 1, 0].item(), 1.0)
assert 1.0 == pytest.approx(one_hot[0, labels[0, 0, 0], 0, 0].item())
assert 1.0 == pytest.approx(one_hot[0, labels[0, 1, 0], 1, 0].item())
assert 1.0 == pytest.approx(one_hot[1, labels[1, 0, 0], 0, 0].item())
assert 1.0 == pytest.approx(one_hot[1, labels[1, 1, 0], 1, 0].item())

0 comments on commit 4599740

Please sign in to comment.