class_docstr: Samples from the Gumbel-Softmax distribution and optionally discretizes.
  
  Reference: https://arxiv.org/abs/1611.00712, https://arxiv.org/abs/1611.01144
  
  Arguments
  ----------
  tau: float
      non-negative scalar temperature
  hard: bool
      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
  dim: int
      A dimension along which softmax will be computed (default: -1).
  
  Example
  -------
  >>> x = torch.randn((8, 40, 120))
  >>> act = GumbelSoftmax(0.8, True)
  >>> x = act(x)
class_docstr_tok: ["Samples","from","the","Gumbel-Softmax","distribution","and","optionally","discretizes",".","Reference",":","https",":","\/\/arxiv.org\/abs\/1611.00712",",","https",":","\/\/arxiv.org\/abs\/1611.01144","Arguments","--","--","--","--","--","tau",":","float","non-negative","scalar","temperature","hard",":","bool","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","dim",":","int","A","dimension","along","which","softmax","will","be","computed","(","default",":","-1",")",".","Example","--","--","--","-",">",">",">","x","=","torch.randn","(","(","8",",","40",",","120",")",")",">",">",">","act","=","GumbelSoftmax","(","0.8",",","True",")",">",">",">","x","=","act","(","x",")"]
code: def __init__(self, tau, hard=False, apply_log=False):
      super().__init__()
      self.tau = tau
      self.hard = hard
      self.apply_log = apply_log
  
file_path: speechbrain/speechbrain/nnet/activations.py
imports: import torch
  import logging
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new GumbelSoftmax object from inherited base classes: torch.nn with example: obj = GumbelSoftmax(tau, hard, apply_log)