code: def uniform_weights(x, x_mask):
      """Return uniform weights over non-masked input."""
      alpha = Variable(torch.ones(x.size(0), x.size(1)))
      if x.data.is_cuda:
          alpha = alpha.cuda()
      alpha = alpha * x_mask.eq(0).float()
      alpha = alpha / alpha.sum(1, keepdim=True).expand(alpha.size())
      return alpha
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
  import sru
label_desc: Use image node_id 1 for calling a global function with example usage: uniform_weights(x, x_mask) and returns: alpha