Skip to content

Commit

Permalink
gumbel
Browse files Browse the repository at this point in the history
  • Loading branch information
srush committed Nov 8, 2020
1 parent 16032e0 commit 0f3b577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch_struct/semirings/sample.py
Expand Up @@ -102,7 +102,7 @@ def forward(ctx, logits, dim):
@staticmethod
def backward(ctx, grad_output):
logits, = ctx.saved_tensors
return logits.softmax(-1), None
return logits.softmax(-1) * grad_output, None

class _GumbelCRFLogSumExp(torch.autograd.Function):
@staticmethod
Expand Down

0 comments on commit 0f3b577

Please sign in to comment.