code: def _roll_last(X, dim):
      if dim == -1:
          return X
      elif dim < 0:
          dim = X.dim() - dim
  
      perm = [i for i in range(X.dim()) if i != dim] + [dim]
      return X.permute(perm)
  
imports: import torch
  import torch.nn
  from torch.autograd import Function
label_desc: Use image node_id 2 for calling a global function with example usage: _roll_last(X, dim) and returns: X, X