parameters: (self, mode, labels)
return_statement: return labels_tensor
docstring: Applies transformations to labels tensor.
docstring_summary: Applies transformations to labels tensor.
docstring_tokens: Applies transformations to labels tensor .
function: def _transform_labels(self, mode, labels):
      """Applies transformations to labels tensor."""
      if (mode == model_fn.ModeKeys.INFER) or (labels is None):
        return None
      labels_tensor = _to_labels_tensor(labels, self._label_name)
      _check_no_sparse_tensor(labels_tensor)
      return labels_tensor
function_tokens: def _transform_labels ( self , mode , labels ) : if ( mode == model_fn . ModeKeys . INFER ) or ( labels is None ) : return None labels_tensor = _to_labels_tensor ( labels , self . _label_name ) _check_no_sparse_tensor ( labels_tensor ) return labels_tensor