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: Splits the tensor from a batch by beams into a batch of 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].
  
  Raises:
    ValueError: If, after reshaping, the new tensor is not shaped
      `[batch_size, beam_width, s]` (assuming batch_size and beam_width
      are known statically).
docstr_tok: ["Splits","the","tensor","from","a","batch","by","beams","into","a","batch","of","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","]",".","Raises",":","ValueError",":","If",",","after","reshaping",",","the","new","tensor","is","not","shaped","`","[","batch_size",",","beam_width",",","s","]","`","(","assuming","batch_size","and","beam_width","are","known","statically",")","."]
code: def _split_batch_beams(self, t, s=None):
      """Splits the tensor from a batch by beams into a batch of 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].
  
      Raises:
        ValueError: If, after reshaping, the new tensor is not shaped
          `[batch_size, beam_width, s]` (assuming batch_size and beam_width
          are known statically).
      """
      s = _as_shape(s)
      t_shape = tf.shape(t)
      reshaped_t = tf.reshape(
          t,
          tf.concat(
              ([self._batch_size, self._beam_width], t_shape[1:]), 0
          ),
      )
      static_batch_size = tf.get_static_value(self._batch_size)
      expected_reshaped_shape = tf.TensorShape(
          [static_batch_size, self._beam_width]
      ).concatenate(s)
      if not reshaped_t.shape.is_compatible_with(
          expected_reshaped_shape
      ):
          raise ValueError(
              "Unexpected behavior when reshaping between beam width "
              "and batch size.  The reshaped tensor has shape: %s.  "
              "We expected it to have shape "
              "(batch_size, beam_width, depth) == %s.  Perhaps you "
              "forgot to call get_initial_state with "
              "batch_size=encoder_batch_size * beam_width?"
              % (reshaped_t.shape, expected_reshaped_shape)
          )
      reshaped_t.set_shape(expected_reshaped_shape)
      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 8 for calling the BeamSearchDecoderMixin obj's underlying member method code with example usage: obj._split_batch_beams(t, s) and returns: reshaped_t