Samples from the Gumbel-Softmax distribution and optionally discretizes.
nnf_gumbel_softmax(logits, tau = 1, hard = FALSE, dim = -1)
[..., num_features]
unnormalized log probabilities
non-negative scalar temperature
if True
, the returned samples will be discretized as one-hot vectors, but will be differentiated as if it is the soft sample in autograd
(int) A dimension along which softmax will be computed. Default: -1.