parameters: (tensor, tag=None)
docstring: Summarize a tensor using a suitable summary type.
  
    This function adds a summary op for `tensor`. The type of summary depends on
    the shape of `tensor`. For scalars, a `scalar_summary` is created, for all
    other tensors, `histogram_summary` is used.
  
    Args:
      tensor: The tensor to summarize
      tag: The tag to use, if None then use tensor's op's name.
  
    Returns:
      The summary op created or None for string tensors.
docstring_summary: Summarize a tensor using a suitable summary type.
docstring_tokens: Summarize a tensor using a suitable summary type .
function: def summarize_tensor(tensor, tag=None):
    """Summarize a tensor using a suitable summary type.
  
    This function adds a summary op for `tensor`. The type of summary depends on
    the shape of `tensor`. For scalars, a `scalar_summary` is created, for all
    other tensors, `histogram_summary` is used.
  
    Args:
      tensor: The tensor to summarize
      tag: The tag to use, if None then use tensor's op's name.
  
    Returns:
      The summary op created or None for string tensors.
    """
    # Skips string tensors and boolean tensors (not handled by the summaries).
    if (tensor.dtype.is_compatible_with(dtypes.string) or
        tensor.dtype.base_dtype == dtypes.bool):
      return None
  
    if tensor.get_shape().ndims == 0:
      # For scalars, use a scalar summary.
      return _add_scalar_summary(tensor, tag)
    else:
      # We may land in here if the rank is still unknown. The histogram won't
      # hurt if this ends up being a scalar.
      return _add_histogram_summary(tensor, tag)
function_tokens: def summarize_tensor ( tensor , tag = None ) : # Skips string tensors and boolean tensors (not handled by the summaries). if ( tensor . dtype . is_compatible_with ( dtypes . string ) or tensor . dtype . base_dtype == dtypes . bool ) : return None if tensor . get_shape ( ) . ndims == 0 : # For scalars, use a scalar summary. return _add_scalar_summary ( tensor , tag ) else : # We may land in here if the rank is still unknown. The histogram won't # hurt if this ends up being a scalar. return _add_histogram_summary ( tensor , tag )