code: def triudr(X, r):
      Zr = torch.zeros_like(X, requires_grad=False)
      U = X * r
      Zr[:-1] = X[:-1] * revcumsum(U)[1:]
  
      return Zr
  
imports: import time
  import numpy
  import scipy.special
  import torch
  import torch.nn
  from .None import constants
  from .None import syssettings
  from .fginitialize import ChunkDataLoader
label_desc: Use image node_id 3 for calling a global function with example usage: triudr(X, r) and returns: Zr