class_docstr: BeamSearchDecoderMixin contains the common methods for
  BeamSearchDecoder.
  
  It is expected to be used a base class for concrete
  BeamSearchDecoder. Since this is a mixin class, it is expected to be
  used together with other class as base.
docstr: Perform a decoding step.
  
  Args:
    time: scalar `int32` tensor.
    inputs: A (structure of) input tensors.
    state: A (structure of) state tensors and TensorArrays.
    training: Python boolean. Indicates whether the layer should
        behave in training mode or in inference mode. Only relevant
        when `dropout` or `recurrent_dropout` is used.
    name: Name scope for any created operations.
  
  Returns:
    `(outputs, next_state, next_inputs, finished)`.
docstr_tok: ["Perform","a","decoding","step",".","Args",":","time",":","scalar","`","int32","`","tensor",".","inputs",":","A","(","structure","of",")","input","tensors",".","state",":","A","(","structure","of",")","state","tensors","and","TensorArrays",".","training",":","Python","boolean",".","Indicates","whether","the","layer","should","behave","in","training","mode","or","in","inference","mode",".","Only","relevant","when","`","dropout","`","or","`","recurrent_dropout","`","is","used",".","name",":","Name","scope","for","any","created","operations",".","Returns",":","`","(","outputs",",","next_state",",","next_inputs",",","finished",")","`","."]
code: def step(self, time, inputs, state, training=None, name=None):
      """Perform a decoding step.
  
      Args:
        time: scalar `int32` tensor.
        inputs: A (structure of) input tensors.
        state: A (structure of) state tensors and TensorArrays.
        training: Python boolean. Indicates whether the layer should
            behave in training mode or in inference mode. Only relevant
            when `dropout` or `recurrent_dropout` is used.
        name: Name scope for any created operations.
  
      Returns:
        `(outputs, next_state, next_inputs, finished)`.
      """
      batch_size = self._batch_size
      beam_width = self._beam_width
      end_token = self._end_token
      length_penalty_weight = self._length_penalty_weight
      coverage_penalty_weight = self._coverage_penalty_weight
  
      with tf.name_scope(name or "BeamSearchDecoderStep"):
          cell_state = state.cell_state
          inputs = tf.nest.map_structure(
              lambda inp: self._merge_batch_beams(inp, s=inp.shape[2:]),
              inputs,
          )
          cell_state = tf.nest.map_structure(
              self._maybe_merge_batch_beams,
              cell_state,
              self._cell.state_size,
          )
          cell_outputs, next_cell_state = self._cell(
              inputs, cell_state, training=training
          )
          cell_outputs = tf.nest.map_structure(
              lambda out: self._split_batch_beams(out, out.shape[1:]),
              cell_outputs,
          )
          next_cell_state = tf.nest.pack_sequence_as(
              cell_state, tf.nest.flatten(next_cell_state)
          )
          next_cell_state = tf.nest.map_structure(
              self._maybe_split_batch_beams,
              next_cell_state,
              self._cell.state_size,
          )
  
          if self._output_layer is not None:
              cell_outputs = self._output_layer(cell_outputs)
  
          beam_search_output, beam_search_state = _beam_search_step(
              time=time,
              logits=cell_outputs,
              next_cell_state=next_cell_state,
              beam_state=state,
              batch_size=batch_size,
              beam_width=beam_width,
              end_token=end_token,
              length_penalty_weight=length_penalty_weight,
              coverage_penalty_weight=coverage_penalty_weight,
              output_all_scores=self._output_all_scores,
          )
  
          finished = beam_search_state.finished
          sample_ids = beam_search_output.predicted_ids
          next_inputs = tf.cond(
              tf.reduce_all(finished),
              lambda: self._start_inputs,
              lambda: self._embedding_fn(sample_ids),
          )
  
      return (
          beam_search_output,
          beam_search_state,
          next_inputs,
          finished,
      )
  
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 12 for calling the BeamSearchDecoderMixin obj's underlying member method code with example usage: obj.step(time, inputs, state, training, name) and returns: beam_search_output,  beam_search_state,  next_inputs,  finished