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 output_dtype(self):
      # Assume the dtype of the cell is the output_size structure
      # containing the input_state's first component's dtype.
      # Return that structure and int32 (the id)
      dtype = tf.nest.flatten(self._initial_cell_state)[0].dtype
      return BeamSearchDecoderOutput(
          scores=tf.nest.map_structure(
              lambda _: dtype, self._rnn_output_size()
          ),
          predicted_ids=tf.int32,
          parent_ids=tf.int32,
      )
  
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 3 for calling the BeamSearchDecoder obj's underlying member method code with example usage: obj.output_dtype() and returns: BeamSearchDecoderOutput