Skip to content

Commit 328f3c6

Browse files
committed
Fix backward
1 parent 534f3bc commit 328f3c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def train(args: Namespace, seed: int = 0, verbose: bool = False) -> Tuple[List[D
201201
loss = apply_ctc_loss(floss, output, int_targets)
202202

203203
# Backward
204-
loss.sum().backward()
204+
loss.backward(torch.ones_like(loss.data))
205205

206206
# Update
207207
optimizer.step()

0 commit comments

Comments
 (0)