class_docstr: Decodes the output of Beam Search to get the top hypotheses
class_docstr_tok: ["Decodes","the","output","of","Beam","Search","to","get","the","top","hypotheses"]
code: def __init__(
      self, eos_token_id, length_penalty, nbest, beam_size, stop_at_eos
  ):
      super().__init__()
      self.eos_token_id = torch.jit.Attribute(eos_token_id, int)
      self.length_penalty = torch.jit.Attribute(length_penalty, float)
      self.nbest = torch.jit.Attribute(nbest, int)
      self.beam_size = torch.jit.Attribute(beam_size, int)
      self.stop_at_eos = torch.jit.Attribute(int(stop_at_eos), int)
  
imports: import math
  from typing import List, Tuple
  import torch
  from fairseq import search, utils
  from fairseq.models import FairseqIncrementalDecoder
  from pytorch_translate import utils
  from torch import Tensor
label_desc: Use image node_id 1 to create a new BeamDecode object from inherited base classes: torch.jit with example: obj = BeamDecode(eos_token_id, length_penalty, nbest, beam_size, stop_at_eos)