docstr: Generate translations. Match the api of other fairseq generators.
  
  Args:
      models (List[~fairseq.models.FairseqModel]): ensemble of models
      sample (dict): batch
      prefix_tokens (dict of torch.LongTensor, optional): force decoder to begin
          with these tokens
      constraints (torch.LongTensor, optional): force decoder to include
          the list of constraints
      bos_token (int, optional): beginning of sentence token
          (default: self.eos)
docstr_tok: ["Generate","translations",".","Match","the","api","of","other","fairseq","generators",".","Args",":","models","(","List","[","~fairseq.models.FairseqModel","]",")",":","ensemble","of","models","sample","(","dict",")",":","batch","prefix_tokens","(","dict","of","torch.LongTensor",",","optional",")",":","force","decoder","to","begin","with","these","tokens","constraints","(","torch.LongTensor",",","optional",")",":","force","decoder","to","include","the","list","of","constraints","bos_token","(","int",",","optional",")",":","beginning","of","sentence","token","(","default",":","self.eos",")"]
code: def generate(
      self, models, sample: Dict[str, Dict[str, Tensor]], **kwargs
  ):
      """Generate translations. Match the api of other fairseq generators.
  
      Args:
          models (List[~fairseq.models.FairseqModel]): ensemble of models
          sample (dict): batch
          prefix_tokens (dict of torch.LongTensor, optional): force decoder to begin
              with these tokens
          constraints (torch.LongTensor, optional): force decoder to include
              the list of constraints
          bos_token (int, optional): beginning of sentence token
              (default: self.eos)
      """
      return self._generate(sample, **kwargs)
  
imports: import math
  from typing import Dict, List, Optional
  from omegaconf.listconfig import ListConfig
  from omegaconf.dictconfig import DictConfig
  import torch
  import torch.nn
  from fairseq.models import FairseqIncrementalDecoder
  from torch import Tensor
  from fairseq.ngram_repeat_block import NGramRepeatBlock
  from .multichannel_search import ContiguousMultichannelBeamSearch
  from fairseq.models.speech_dlm import SpeechDLM
label_desc: Use image node_id 4 for calling the MultichannelSequenceGenerator obj's underlying member method code with example usage: obj.generate(models, sample) and returns: self