class_docstr: Beam search decoder.
  
  **NOTE** If you are using the `BeamSearchDecoder` with a cell wrapped in
  `tfa.seq2seq.AttentionWrapper`, then you must ensure that:
  
  - The encoder output has been tiled to `beam_width` via
    `tfa.seq2seq.tile_batch` (NOT `tf.tile`).
  - The `batch_size` argument passed to the `get_initial_state` method of
    this wrapper is equal to `true_batch_size * beam_width`.
  - The initial state created with `get_initial_state` above contains a
    `cell_state` value containing properly tiled final state from the
    encoder.
  
  An example:
  
  ```
  tiled_encoder_outputs = tfa.seq2seq.tile_batch(
      encoder_outputs, multiplier=beam_width)
  tiled_encoder_final_state = tfa.seq2seq.tile_batch(
      encoder_final_state, multiplier=beam_width)
  tiled_sequence_length = tfa.seq2seq.tile_batch(
      sequence_length, multiplier=beam_width)
  attention_mechanism = MyFavoriteAttentionMechanism(
      num_units=attention_depth,
      memory=tiled_inputs,
      memory_sequence_length=tiled_sequence_length)
  attention_cell = AttentionWrapper(cell, attention_mechanism, ...)
  decoder_initial_state = attention_cell.get_initial_state(
      batch_size=true_batch_size * beam_width, dtype=dtype)
  decoder_initial_state = decoder_initial_state.clone(
      cell_state=tiled_encoder_final_state)
  ```
  
  Meanwhile, with `tfa.seq2seq.AttentionWrapper`, coverage penalty is suggested to use
  when computing scores (https://arxiv.org/pdf/1609.08144.pdf). It encourages
  the decoding to cover all inputs.
code: def call(
      self,
      embedding,
      start_tokens,
      end_token,
      initial_state,
      training=None,
      **kwargs,
  ):
      init_kwargs = kwargs
      init_kwargs["start_tokens"] = start_tokens
      init_kwargs["end_token"] = end_token
      init_kwargs["initial_state"] = initial_state
      return decoder.dynamic_decode(
          self,
          output_time_major=self.output_time_major,
          impute_finished=self.impute_finished,
          maximum_iterations=self.maximum_iterations,
          parallel_iterations=self.parallel_iterations,
          swap_memory=self.swap_memory,
          training=training,
          decoder_init_input=embedding,
          decoder_init_kwargs=init_kwargs,
      )
  
imports: import collections
  import numpy
  import tensorflow
  from tensorflow_addons import options
  from tensorflow_addons.seq2seq import attention_wrapper
  from tensorflow_addons.seq2seq import decoder
  from tensorflow_addons.utils import keras_utils
  from tensorflow_addons.utils.resource_loader import LazySO
  from tensorflow_addons.utils.types import FloatTensorLike, TensorLike, Number
  from typeguard import typechecked
  from typing import Callable, Optional
label_desc: Use image node_id 4 for calling the BeamSearchDecoder obj's underlying member method code with example usage: obj.call(embedding, start_tokens, end_token, initial_state, training) and returns: decoder