parameters: (labels,
                       num_classes,
                       on_value=1.0,
                       off_value=0.0,
                       outputs_collections=None,
                       scope=None)
docstring: Transform numeric labels into onehot_labels using tf.one_hot.
  
    Args:
      labels: [batch_size] target labels.
      num_classes: total number of classes.
      on_value: A scalar defining the on-value.
      off_value: A scalar defining the off-value.
      outputs_collections: collection to add the outputs.
      scope: Optional scope for op_scope.
  
    Returns:
      one hot encoding of the labels.
docstring_summary: Transform numeric labels into onehot_labels using tf.one_hot.
docstring_tokens: Transform numeric labels into onehot_labels using tf . one_hot .
function: def one_hot_encoding(labels,
                       num_classes,
                       on_value=1.0,
                       off_value=0.0,
                       outputs_collections=None,
                       scope=None):
    """Transform numeric labels into onehot_labels using tf.one_hot.
  
    Args:
      labels: [batch_size] target labels.
      num_classes: total number of classes.
      on_value: A scalar defining the on-value.
      off_value: A scalar defining the off-value.
      outputs_collections: collection to add the outputs.
      scope: Optional scope for op_scope.
  
    Returns:
      one hot encoding of the labels.
    """
    with ops.op_scope([labels, num_classes], scope, 'OneHotEncoding') as sc:
      labels = ops.convert_to_tensor(labels)
      if labels.dtype == dtypes.int32:
        labels = standard_ops.to_int64(labels)
      outputs = standard_ops.one_hot(labels,
                                     num_classes,
                                     on_value=on_value,
                                     off_value=off_value)
      return utils.collect_named_outputs(outputs_collections, sc, outputs)
function_tokens: def one_hot_encoding ( labels , num_classes , on_value = 1.0 , off_value = 0.0 , outputs_collections = None , scope = None ) : with ops . op_scope ( [ labels , num_classes ] , scope , 'OneHotEncoding' ) as sc : labels = ops . convert_to_tensor ( labels ) if labels . dtype == dtypes . int32 : labels = standard_ops . to_int64 ( labels ) outputs = standard_ops . one_hot ( labels , num_classes , on_value = on_value , off_value = off_value ) return utils . collect_named_outputs ( outputs_collections , sc , outputs )