class_docstr: Beam search for seq2seq/encoder-decoder models
class_docstr_tok: ["Beam","search","for","seq2seq\/encoder-decoder","models"]
docstr: Initialize for decoding.
  Repeat src objects `beam_size` times.
docstr_tok: ["Initialize","for","decoding",".","Repeat","src","objects","`","beam_size","`","times","."]
code: def initialize(
      self,
      enc_out,
      src_len,
      src_map=None,
      device=None,
      target_prefix=None,
  ):
      """Initialize for decoding.
      Repeat src objects `beam_size` times.
      """
  
      (
          fn_map_state,
          enc_out,
          src_map,
          target_prefix,
      ) = self.initialize_tile(enc_out, src_len, src_map, target_prefix)
      if device is None:
          device = self.get_device_from_enc_out(enc_out)
  
      super(BeamSearch, self).initialize_(
          enc_out, src_map, device, target_prefix
      )
  
      return fn_map_state, enc_out, src_map
  
imports: import torch
  from onmt.translate import penalties
  from onmt.translate.decode_strategy import DecodeStrategy
  import warnings
label_desc: Use image node_id 1 for calling the BeamSearch obj's underlying member method code with example usage: obj.initialize(enc_out, src_len, src_map, device, target_prefix) and returns: fn_map_state,  enc_out,  src_map