Skip to content

Commit

Permalink
Update linearchain.py (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
srush committed Oct 13, 2021
1 parent a484559 commit 5328ec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch_struct/linearchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def logpartition(self, log_potentials, lengths=None, force_grad=False):
chart = self._chart((batch, bin_N, C, C), log_potentials, force_grad)

# Init
init = torch.zeros(*chart.shape).bool()
init = torch.zeros_like(chart).bool()
init.diagonal(0, 3, 4).fill_(True)
chart = semiring.fill(chart, init, semiring.one)

Expand Down

0 comments on commit 5328ec5

Please sign in to comment.