docstr: Beam Search sequence generator based on the decoder followed by
  log_softmax.
  
  Args:
      *all args of GreedySequenceGenerator class
      beam_size: size of the beam
      len_pen: length penalty parameter
  Kwargs:
      all remaining parameters of GreedySequenceGenerator class
docstr_tok: ["Beam","Search","sequence","generator","based","on","the","decoder","followed","by","log_softmax",".","Args",":","*","all","args","of","GreedySequenceGenerator","class","beam_size",":","size","of","the","beam","len_pen",":","length","penalty","parameter","Kwargs",":","all","remaining","parameters","of","GreedySequenceGenerator","class"]
code: def __init__(
      self,
      embedding,
      decoder,
      log_softmax,
      beam_size=1,
      len_pen=0,
      **kwargs,
  ):
      """
      Beam Search sequence generator based on the decoder followed by
      log_softmax.
  
      Args:
          *all args of GreedySequenceGenerator class
          beam_size: size of the beam
          len_pen: length penalty parameter
      Kwargs:
          all remaining parameters of GreedySequenceGenerator class
      """
  
      super().__init__(embedding, decoder, log_softmax, **kwargs)
      self.beam_size = beam_size
      self.len_pen = len_pen
  
imports: from contextlib import contextmanager
  import torch
  from nemo.collections.common.parts import NEG_INF, mask_padded_tokens
label_desc: Use image node_id 1 to create a new BeamSearchSequenceGenerator object from inherited base classes: GreedySequenceGenerator with example: obj = BeamSearchSequenceGenerator(embedding, decoder, log_softmax, beam_size, len_pen)