code: def _merge_beam_dim(tensor):
      """Reshapes first two dimensions in to single dimension.
  
      Args:
        tensor: Tensor to reshape of shape [A, B, ...]
  
      Returns:
        Reshaped tensor of shape [A*B, ...]
      """
      shape = shape_list(tensor)
      shape[0] *= shape[1]  # batch -> batch * beam_size
      shape.pop(1)  # Remove beam dim
      return tf.reshape(tensor, shape)
  
file_path: finetune/finetune/util/beam_search.py
imports: import math
  import numpy
  from finetune.util.shapes import shape_list
  import tensorflow
  from tensorflow.python.ops import inplace_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 4 for calling a global function with example usage: _merge_beam_dim(tensor) and returns: tf