def tile_batch(t, multiplier):
  """Tile the batch dimension of a (possibly nested structure of) tensor(s) t.

  Args:
    t: Tensor shaped [batch_size, ...]
    multiplier: <int32>

  Returns:
    A possibly nested structure of Tensor shaped [batch_size * multipler, ...]
  """

  def _tile_batch(t, multiplier):
    """Core single-tensor implementation of tile_batch."""
    tensor = tf.convert_to_tensor(t)
    tensor = tf.expand_dims(tensor, axis=1)
    tile_dims = [1] * tensor.shape.ndims
    tile_dims[1] = multiplier
    tiled = tf.tile(tensor, tile_dims)
    return tf.reshape(tiled, [-1] + shape(tensor)[2:])

  return tf.nest.map_structure(lambda t_: _tile_batch(t_, multiplier), t)
Tile the batch dimension of a (possibly nested structure of) tensor(s) t.

  Args:
    t: Tensor shaped [batch_size, ...]
    multiplier: <int32>

  Returns:
    A possibly nested structure of Tensor shaped [batch_size * multipler, ...]
  
language/capwap/utils/tensor_utils.py