Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'TypeError' of rnnt_loss_pruned function. #924

Merged
merged 7 commits into from
Feb 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix 'TypeError' of rnnt_loss_simple function.
Fix 'TypeError' exception when calling rnnt_loss_simple(..., return_grad=False)  at validation steps.
  • Loading branch information
drawfish authored Feb 22, 2022
commit 64361adef294de7dfced4229604c585f59b89aff
2 changes: 1 addition & 1 deletion k2/python/k2/mutual_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def forward(

ans = _k2.mutual_information_forward(px, py, boundary, p)

px_grad, py_grad = None, None
px_grad, py_grad = torch.Tensor(), torch.Tensor()
if return_grad or px.requires_grad or py.requires_grad:
ans_grad = torch.ones(B, device=px.device, dtype=px.dtype)
(px_grad, py_grad) = _k2.mutual_information_backward(
Expand Down