code: def rand_stride(t):
      """Add stride to the last dimension of a tensor."""
      stride = np.random.randint(2, 4)
      ret = torch.stack([t] * stride, dim=-1)[..., 0]
      ret = ret.detach()
      if torch.is_floating_point(t):
          ret.requires_grad_()
      return ret
  
file_path: dgl/tests/python/pytorch/sparse/utils.py
imports: import numpy
  import torch
  from dgl.sparse import diag, from_csc, from_csr, SparseMatrix, spmatrix
label_desc: Use image node_id 2 for calling a global function with example usage: rand_stride(t) and returns: ret