Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kiersten-stokes committed May 8, 2023
1 parent 8ec74a9 commit c2cc683
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions torch/csrc/autograd/python_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,10 @@ int THPVariable_set_grad(THPVariable* self, PyObject* py_grad, void* unused) {
const auto& grad = THPVariable_Unpack(py_grad);
TORCH_CHECK_TYPE(
var.dtype() == grad.dtype(),
"assigned grad has data of type ", grad.dtype(),
" that differs from the required type ", var.dtype());
"assigned grad has data of type ",
grad.dtype(),
" that differs from the required type ",
var.dtype());
bool gradIsSparse =
(var.dtype() == grad.dtype() &&
var.device().type() == grad.device().type() && grad.layout() == kSparse);
Expand Down

0 comments on commit c2cc683

Please sign in to comment.