parameters: (labels)
docstring: Return a tensor to use for input labels to tensor_forest.
  
    The incoming targets can be a dict where keys are the string names of the
    columns, which we turn into a single 1-D tensor for classification or
    2-D tensor for regression.
  
    Converts sparse tensors to dense ones.
  
    Args:
      labels: `Tensor` or `dict` of `Tensor` objects.
  
    Returns:
      A 2-D tensor for labels/outputs.
docstring_summary: Return a tensor to use for input labels to tensor_forest.
docstring_tokens: Return a tensor to use for input labels to tensor_forest .
function: def ParseLabelTensorOrDict(labels):
    """Return a tensor to use for input labels to tensor_forest.
  
    The incoming targets can be a dict where keys are the string names of the
    columns, which we turn into a single 1-D tensor for classification or
    2-D tensor for regression.
  
    Converts sparse tensors to dense ones.
  
    Args:
      labels: `Tensor` or `dict` of `Tensor` objects.
  
    Returns:
      A 2-D tensor for labels/outputs.
    """
    if isinstance(labels, dict):
      return math_ops.to_float(array_ops.concat(
          1, [sparse_ops.sparse_tensor_to_dense(labels[
              k], default_value=-1) if isinstance(labels, ops.SparseTensor) else
              labels[k] for k in sorted(labels.keys())]))
    else:
      if isinstance(labels, ops.SparseTensor):
        return math_ops.to_float(sparse_ops.sparse_tensor_to_dense(
            labels, default_value=-1))
      else:
        return math_ops.to_float(labels)
function_tokens: def ParseLabelTensorOrDict ( labels ) : if isinstance ( labels , dict ) : return math_ops . to_float ( array_ops . concat ( 1 , [ sparse_ops . sparse_tensor_to_dense ( labels [ k ] , default_value = - 1 ) if isinstance ( labels , ops . SparseTensor ) else labels [ k ] for k in sorted ( labels . keys ( ) ) ] ) ) else : if isinstance ( labels , ops . SparseTensor ) : return math_ops . to_float ( sparse_ops . sparse_tensor_to_dense ( labels , default_value = - 1 ) ) else : return math_ops . to_float ( labels )