class_docstr: The dual task loss implement of GSCNN
  
  Args:
      ignore_index (int64): Specifies a target value that is ignored
          and does not contribute to the input gradient. Default ``255``.
      tau (float): the tau of gumbel softmax sample.
class_docstr_tok: ["The","dual","task","loss","implement","of","GSCNN","Args",":","ignore_index","(","int64",")",":","Specifies","a","target","value","that","is","ignored","and","does","not","contribute","to","the","input","gradient",".","Default","``","255","``",".","tau","(","float",")",":","the","tau","of","gumbel","softmax","sample","."]
docstr: Draw a sample from the Gumbel-Softmax distribution
  
  based on
  https://github.com/ericjang/gumbel-softmax/blob/3c8584924603869e90ca74ac20a6a03d99a91ef9/Categorical%20VAE.ipynb
  (MIT license)
docstr_tok: ["Draw","a","sample","from","the","Gumbel-Softmax","distribution","based","on","https",":","\/\/github.com\/ericjang\/gumbel-softmax\/blob\/3c8584924603869e90ca74ac20a6a03d99a91ef9\/Categorical","%","20VAE.ipynb","(","MIT","license",")"]
code: def _gumbel_softmax_sample(self, logit, tau=1, eps=1e-10):
      """
      Draw a sample from the Gumbel-Softmax distribution
  
      based on
      https://github.com/ericjang/gumbel-softmax/blob/3c8584924603869e90ca74ac20a6a03d99a91ef9/Categorical%20VAE.ipynb
      (MIT license)
      """
      gumbel_noise = paddle.rand(logit.shape)
      gumbel_noise = -paddle.log(eps - paddle.log(gumbel_noise + eps))
      logit = logit + gumbel_noise
      return F.softmax(logit / tau, axis=1)
  
file_path: PaddleSeg/paddleseg/models/losses/gscnn_dual_task_loss.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 2 for calling the DualTaskLoss obj's underlying member method code with example usage: obj._gumbel_softmax_sample(logit, tau, eps) and returns: F