Skip to content

Commit

Permalink
fix(autograd): fix different dtype backward bug (#8309)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyg1997 authored May 26, 2022
1 parent d8c57af commit dd83698
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions python/oneflow/test/modules/test_autograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ def test_scalar_leaf_tensor_backward(test_case):

@autotest(n=1, auto_backward=False, check_graph=False)
def test_out_grad_with_different_dtype(test_case):
device = random_device()
x = random_tensor(ndim=2, requires_grad=True)
x = x.to(device)
y = x.sum()
y.backward(torch.tensor(False))
return x.grad
Expand Down

0 comments on commit dd83698

Please sign in to comment.