(past: Tuple, beam_idx: Tensor)
| 842 | |
| 843 | @staticmethod |
| 844 | def _reorder_cache(past: Tuple, beam_idx: Tensor) -> Tuple[Tensor]: |
| 845 | return tuple(layer_past.index_select(1, beam_idx) for layer_past in past) |
| 846 | |
| 847 | |
| 848 | def calc_banned_ngram_tokens(prev_input_ids: Tensor, num_hypos: int, no_repeat_ngram_size: int, cur_len: int) -> None: |
no outgoing calls
no test coverage detected