code: def sparse2th(mat):
      value = mat.data
      indices = th.LongTensor([mat.row, mat.col])
      tensor = th.sparse.FloatTensor(
          indices, th.from_numpy(value).float(), mat.shape
      )
      return tensor
  
imports: import os
  import dgl
  import torch
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.data import citation_graph
  import matplotlib.pyplot
  import networkx
  import dgl.function
  from torch.utils.data import DataLoader
label_desc: Use image node_id 3 for calling a global function with example usage: sparse2th(mat) and returns: tensor