Skip to content

Commit

Permalink
fix bug for returning intermediate states
Browse files Browse the repository at this point in the history
  • Loading branch information
YosukeHiguchi committed May 18, 2022
1 parent 3c96908 commit 49100e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion espnet/nets/pytorch_backend/e2e_asr_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def forward(self, xs_pad, ilens, ys_pad):
# 1. forward encoder
xs_pad = xs_pad[:, : max(ilens)] # for data parallel
src_mask = make_non_pad_mask(ilens.tolist()).to(xs_pad.device).unsqueeze(-2)
hs_pad, hs_mask, hs_intermediates = self.encoder(xs_pad, src_mask)
if self.intermediate_ctc_layers:
hs_pad, hs_mask, hs_intermediates = self.encoder(xs_pad, src_mask)
else:
hs_pad, hs_mask = self.encoder(xs_pad, src_mask)
self.hs_pad = hs_pad

# 2. forward decoder
Expand Down

0 comments on commit 49100e4

Please sign in to comment.