% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nnf-embedding.R
\name{nnf_one_hot}
\alias{nnf_one_hot}
\title{One_hot}
\usage{
nnf_one_hot(tensor, num_classes = -1)
}
\arguments{
\item{tensor}{(LongTensor) class values of any shape.}

\item{num_classes}{(int) Total number of classes. If set to -1, the number
of classes will be inferred as one greater than the largest class value in
the input tensor.}
}
\description{
Takes LongTensor with index values of shape \verb{(*)} and returns a tensor
of shape \verb{(*, num_classes)} that have zeros everywhere except where the
index of last dimension matches the corresponding value of the input tensor,
in which case it will be 1.
}
\details{
One-hot on Wikipedia: https://en.wikipedia.org/wiki/One-hot
}
