Create one-hot encoding vector as a LazyTensor object.
Usage
one_hot(x, D)
Value
a LazyTensor.
Arguments
x
A LazyTensor encoding a scalar value.
D
an integer corresponding to the output dimension.
Author
Chloe Serre-Combe, Amelie Vernay
Details
If x is a scalar value encoded as a LazyTensor,
one_hot(x, D) encodes, symbolically, a vector of length D
where round(x)-th coordinate is equal to 1, and the other ones to 0.