Skip to content

Commit

Permalink
fix grads
Browse files Browse the repository at this point in the history
  • Loading branch information
bamos committed Feb 4, 2020
1 parent 0eed02f commit cf8251e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lml.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def backward(ctx, grad_output):
dx = torch.zeros_like(x)
if single:
dx = dx.squeeze()
return dx
grads = tuple([dx] + [None]*5)
return grads

Hinv = 1./(1./y + 1./(1.-y))
dnu = bdot(Hinv, grad_output)/Hinv.sum(dim=1)
Expand Down

0 comments on commit cf8251e

Please sign in to comment.