code: def csr_to_coo(indices, indptr, shape):
      n_rows, n_cols = shape
      cols = indices
      rows = [0] * len(cols)
      for i in range(n_rows):
          for j in range(indptr[i], indptr[i + 1]):
              rows[j] = i
      return torch.tensor([rows, cols], dtype=torch.long)
  
file_path: pytorch/benchmarks/sparse/dlmc/utils.py
imports: import math
  from pathlib import Path
  import torch
  from scipy import sparse
label_desc: Use image node_id 4 for calling a global function with example usage: csr_to_coo(indices, indptr, shape) and returns: torch