Calc predictor chunk. Args: encoder_out: Encoder output tensor. encoder_out_lens: Encoder output lengths. cache: State cache dict for streaming inference. **kwargs: Additional keyword arguments.
(self, encoder_out, encoder_out_lens, cache=None, **kwargs)
| 346 | return encoder_out, torch.tensor([encoder_out.size(1)]) |
| 347 | |
| 348 | def calc_predictor_chunk(self, encoder_out, encoder_out_lens, cache=None, **kwargs): |
| 349 | """Calc predictor chunk. |
| 350 | |
| 351 | Args: |
| 352 | encoder_out: Encoder output tensor. |
| 353 | encoder_out_lens: Encoder output lengths. |
| 354 | cache: State cache dict for streaming inference. |
| 355 | **kwargs: Additional keyword arguments. |
| 356 | """ |
| 357 | is_final = kwargs.get("is_final", False) |
| 358 | |
| 359 | return self.predictor.forward_chunk(encoder_out, cache["encoder"], is_final=is_final) |
| 360 | |
| 361 | def _calc_att_predictor_loss( |
| 362 | self, |
no test coverage detected