code: def sample_gumbel(shape, device, dtype, eps=1e-6):
      u = torch.empty(shape, device=device, dtype=dtype).uniform_(0, 1)
      return -log(-log(u, eps), eps)
  
imports: import torch
  import torch.nn.functional
  from torch.nn.utils.rnn import pad_sequence
  from torch import nn, einsum
  from einops import rearrange, repeat
  from einops.layers.torch import Rearrange
label_desc: Use image node_id 4 for calling a global function with example usage: sample_gumbel(shape, device, dtype, eps) and returns: unknown