(tensor, batch_size, beam_size)
return tf.reshape(tensor, new_shape)
Reshapes first dimension back to [batch_size, beam_size].
Reshapes first dimension back to [batch_size, beam_size].
Reshapes first dimension back to [ batch_size beam_size ] .
def unmerge_beam_dim(tensor, batch_size, beam_size):
  """Reshapes first dimension back to [batch_size, beam_size]."""
  shape = shape_list(tensor)
  new_shape = [batch_size] + [beam_size] + shape[1:]
  return tf.reshape(tensor, new_shape)
def unmerge_beam_dim ( tensor , batch_size , beam_size ) : shape = shape_list ( tensor ) new_shape = [ batch_size ] + [ beam_size ] + shape [ 1 : ] return tf . reshape ( tensor , new_shape )