espnet2.main_funcs.calculate_all_attentions.calculate_all_attentions
Less than 1 minute
espnet2.main_funcs.calculate_all_attentions.calculate_all_attentions
espnet2.main_funcs.calculate_all_attentions.calculate_all_attentions(model: AbsESPnetModel, batch: Dict[str, Tensor]) → Dict[str, List[Tensor]]
Derive the outputs from the all attention layers
- Parameters:
- model
- batch – same as forward
- Returns: A dict of a list of tensor. key_names x batch x (D1, D2, …)
- Return type: return_dict