(tensor)
return tf.reshape(tensor, shape)
Reshapes first two dimensions in to single dimension.
Reshapes first two dimensions in to single dimension.
Reshapes first two dimensions in to single dimension .
def merge_beam_dim(tensor):
  """Reshapes first two dimensions in to single dimension."""
  shape = shape_list(tensor)
  shape[0] *= shape[1]  # batch -> batch * beam_size
  shape.pop(1)  # Remove beam dim
  return tf.reshape(tensor, shape)
def merge_beam_dim ( tensor ) : shape = shape_list ( tensor ) shape [ 0 ] *= shape [ 1 ] # batch -> batch * beam_size shape . pop ( 1 ) # Remove beam dim return tf . reshape ( tensor , shape )