ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more


View source on GitHub

Transform numeric labels into onehot_labels using tf.one_hot.

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 name_scope.

One-hot encoding of the labels.