code: def _make_ix_like(input, dim=0):
      d = input.size(dim)
      rho = torch.arange(
          1, d + 1, device=input.device, dtype=input.dtype
      )
      view = [1] * input.dim()
      view[0] = -1
      return rho.view(view).transpose(0, dim)
  
file_path: OpenNMT-py/onmt/modules/sparse_activations.py
imports: import torch
  from torch.autograd import Function
  from torch.cuda.amp import custom_fwd, custom_bwd
  import torch.nn
label_desc: Use image node_id 1 for calling a global function with example usage: _make_ix_like(input, dim) and returns: rho