Skip to content

Commit

Permalink
Use Tensor.to(torch.bool) instead of Tensor.bool()
Browse files Browse the repository at this point in the history
Tensor.bool() was introduced in PyTorch 1.2.0.
  • Loading branch information
sublee committed Oct 21, 2019
1 parent b68f1a9 commit 61a8a54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_bugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ def forward(self, x):
y = model(x)
y.norm().backward()

assert y.bool().tolist() == x.grad.bool().tolist()
assert y.to(torch.bool).tolist() == x.grad.to(torch.bool).tolist()

0 comments on commit 61a8a54

Please sign in to comment.