def METHOD_NAME(
    self,
    tokenized_sentences: List[Dict[str, torch.LongTensor]],
    beam: int = 5,
    verbose: bool = False,
    skip_invalid_size_inputs=False,
    inference_step_args=None,
    **kwargs
) -> List[List[Dict[str, torch.Tensor]]]:
    if isinstance(tokenized_sentences, dict):
        return self.METHOD_NAME(
            [tokenized_sentences], beam=beam, verbose=verbose, **kwargs
        )[0]
    # build generator using current args as well as any kwargs
    gen_args = copy.deepcopy(self.cfg.generation)
    with open_dict(gen_args):
        gen_args.beam = beam
        for k, v in kwargs.items():
            setattr(gen_args, k, v)
    generator = self.task.build_generator(self.models, gen_args)
    inference_step_args = inference_step_args or {}
    results = []
    for batch in tqdm(
        self._build_batches(tokenized_sentences, skip_invalid_size_inputs)
    ):
        batch = utils.apply_to_sample(lambda t: t.to(self.device), batch)
        translations = self.task.inference_step(
            generator, self.models, batch, **inference_step_args
        )
        for id, hypos in zip(batch["id"].tolist(), translations):
            # The output of the generator is supposed to be a tensor of size (bsz x max_len x n_channels)
            # So we need to convert it to dictionary form
            for i in range(len(hypos)):
                hypos[i]["tokens"] = {
                    channel: hypos[i]["tokens"][..., j]
                    for j, channel in enumerate(self.channels)
                }
            results.append((id, hypos))
    # sort output to match input order
    outputs = [hypos for _, hypos in sorted(results, key=lambda x: x[0])]
    if verbose:
        def getarg(name, default):
            return getattr(gen_args, name, getattr(self.cfg, name, default))
        for source_tokens, target_hypotheses in zip(tokenized_sentences, outputs):
            src_str_with_unk = {
                channel: self.string(source_tokens[channel], channel)
                for channel in source_tokens
            }
            logger.info("S\t{}".format(src_str_with_unk))
            for hypo in target_hypotheses:
                hypo_str = self.decode(hypo["tokens"])
                logger.info("H\t{}\t{}".format(hypo["score"], hypo_str))
                # hypo["positional_scores"]: T x n_channels
                pos_scores = {}
                for c, channel in enumerate(source_tokens):
                    pos_scores[channel] = " ".join(
                        map(
                            lambda x: "{:.4f}".format(x),
                            hypo["positional_scores"][:, c].tolist(),
                        )
                    )
                logger.info("P\t{}".format(pos_scores))
    return outputs