class_docstr: Base class for seq2seq models with embeddings
    
docstr: Wraps a decoder into a Beam Search decoder.
  
  Args:
    decoder: The original decoder
  
  Returns:
    A BeamSearchDecoder with the same interfaces as the original decoder.
docstr_tok: ["Wraps","a","decoder","into","a","Beam","Search","decoder",".","Args",":","decoder",":","The","original","decoder","Returns",":","A","BeamSearchDecoder","with","the","same","interfaces","as","the","original","decoder","."]
code: def _get_beam_search_decoder(self, decoder):
      """Wraps a decoder into a Beam Search decoder.
  
      Args:
        decoder: The original decoder
  
      Returns:
        A BeamSearchDecoder with the same interfaces as the original decoder.
      """
      config = beam_search.BeamSearchConfig(
          beam_width=self.params["inference.beam_search.beam_width"],
          vocab_size=self.target_vocab_info.total_size,
          eos_token=self.target_vocab_info.special_vocab.SEQUENCE_END,
          length_penalty_weight=self.params[
              "inference.beam_search.length_penalty_weight"
          ],
          choose_successors_fn=getattr(
              beam_search,
              self.params["inference.beam_search.choose_successors_fn"],
          ),
      )
      return BeamSearchDecoder(decoder=decoder, config=config)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import collections
  import tensorflow
  from seq2seq import graph_utils
  from seq2seq import losses
  from seq2seq.contrib.seq2seq.decoder import _transpose_batch_time
  from seq2seq.data import vocab
  from seq2seq.graph_utils import templatemethod
  from seq2seq.decoders.beam_search_decoder import BeamSearchDecoder
  from seq2seq.inference import beam_search
  from seq2seq.models.model_base import ModelBase, _flatten_dict
label_desc: Use image node_id 10 for calling the Seq2SeqModel obj's underlying member method code with example usage: obj._get_beam_search_decoder(decoder) and returns: BeamSearchDecoder