Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
srush committed Sep 12, 2019
1 parent fdc0e8d commit 64270f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch_struct/semirings.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def sample(ls):
final = (grad_output % 2).unsqueeze(0)
on = grad_output.unsqueeze(0) % mbits.view(17, * [1]*grad_output.dim())
on = on[1:] - on[:-1]
old_bits = (on + final == 0).unsqueeze(dim+1)
old_bits = (on + final != 0).unsqueeze(dim+1)
grad_input = torch.sum(mbits[:-1].view(16, *[1]*(s.dim()-1)).mul(
old_bits.type_as(s).mul(s)), dim=0)
assert grad_input.shape == logits.shape
Expand Down

0 comments on commit 64270f4

Please sign in to comment.