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: Merges the tensor from a batch of beams into a batch by beams.
  
  More exactly, t is a tensor of dimension [batch_size, beam_width, s].
  We reshape this into [batch_size*beam_width, s]
  
  Args:
    t: Tensor of dimension [batch_size, beam_width, s]
    s: (Possibly known) depth shape.
  
  Returns:
    A reshaped version of t with dimension [batch_size * beam_width, s].
docstr_tok: ["Merges","the","tensor","from","a","batch","of","beams","into","a","batch","by","beams",".","More","exactly",",","t","is","a","tensor","of","dimension","[","batch_size",",","beam_width",",","s","]",".","We","reshape","this","into","[","batch_size","*","beam_width",",","s","]","Args",":","t",":","Tensor","of","dimension","[","batch_size",",","beam_width",",","s","]","s",":","(","Possibly","known",")","depth","shape",".","Returns",":","A","reshaped","version","of","t","with","dimension","[","batch_size","*","beam_width",",","s","]","."]
code: def _merge_batch_beams(self, t, s=None):
      """Merges the tensor from a batch of beams into a batch by beams.
  
      More exactly, t is a tensor of dimension [batch_size, beam_width, s].
      We reshape this into [batch_size*beam_width, s]
  
      Args:
        t: Tensor of dimension [batch_size, beam_width, s]
        s: (Possibly known) depth shape.
  
      Returns:
        A reshaped version of t with dimension [batch_size * beam_width, s].
      """
      s = _as_shape(s)
      t_shape = tf.shape(t)
      static_batch_size = tf.get_static_value(self._batch_size)
      batch_size_beam_width = (
          None
          if static_batch_size is None
          else static_batch_size * self._beam_width
      )
      reshaped_t = tf.reshape(
          t,
          tf.concat(
              ([self._batch_size * self._beam_width], t_shape[2:]), 0
          ),
      )
      reshaped_t.set_shape(
          tf.TensorShape([batch_size_beam_width]).concatenate(s)
      )
      return reshaped_t
  
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 7 for calling the BeamSearchDecoderMixin obj's underlying member method code with example usage: obj._merge_batch_beams(t, s) and returns: reshaped_t