def _get_summary_name(tensor, name=None, prefix=None, postfix=None):
  """Produces the summary name given.

  Args:
    tensor: A variable or op `Tensor`.
    name: The optional name for the summary.
    prefix: An optional prefix for the summary name.
    postfix: An optional postfix for the summary name.

  Returns:
    a summary name.
  """
  if not name:
    name = tensor.op.name
  if prefix:
    name = prefix + '/' + name
  if postfix:
    name = name + '/' + postfix
  return name