code: def _sample_gumbel(shape, eps=1e-10):
      """
      Sample from Gumbel(0, 1)
  
      based on
      https://github.com/ericjang/gumbel-softmax/blob/3c8584924603869e90ca74ac20a6a03d99a91ef9/Categorical%20VAE.ipynb ,
      (MIT license)
      """
      U = torch.rand(shape).cuda()
      return -torch.log(eps - torch.log(U + eps))
  
file_path: pywick/pywick/models/segmentation/testnets/gscnn/my_functionals/DualTaskLoss.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
  from .custom_functional import compute_grad_mag
label_desc: Use image node_id 2 for calling a global function with example usage: _sample_gumbel(shape, eps) and returns: unknown