Skip to content

Commit 0fe13a4

Browse files
author
Caroline Chen
committed
remove tensor moves
1 parent 86ed12a commit 0fe13a4

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

torchaudio/prototype/rnnt_loss.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,6 @@ def rnnt_loss(
105105
False # softmax needs the original logits value
106106
)
107107

108-
# move everything to the same device.
109-
targets = targets.to(device=logits.device)
110-
logit_lengths = logit_lengths.to(device=logits.device)
111-
target_lengths = target_lengths.to(device=logits.device)
112-
113-
# make sure all int tensors are of type int32.
114-
targets = targets.int()
115-
logit_lengths = logit_lengths.int()
116-
target_lengths = target_lengths.int()
117-
118108
if blank < 0: # reinterpret blank index if blank < 0.
119109
blank = logits.shape[-1] + blank
120110

0 commit comments

Comments
 (0)