Skip to content

Commit

Permalink
Fixed bug in total_length
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuigcerver committed Mar 9, 2018
1 parent a4f40b5 commit 432cf33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_binding/warpctc_pytorch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def forward(ctx, acts, labels, act_lens, label_lens, size_average=False,

if length_average:
# Compute the avg. log-probability per batch sample and frame.
total_length = torch.prod(act_lens)
total_length = torch.sum(act_lens)
grads = grads / total_length
costs = costs / total_length
elif size_average:
Expand Down

0 comments on commit 432cf33

Please sign in to comment.