code: def is_sparse_tensor(tensor):
      """Check if a tensor is sparse tensor.
      Parameters
      ----------
      tensor : torch.Tensor
          given tensor
      Returns
      -------
      bool
          whether a tensor is sparse tensor
      """
      # if hasattr(tensor, 'nnz'):
      if tensor.layout == torch.sparse_coo:
          return True
      else:
          return False
  
file_path: AutoGL/autogl/module/model/pyg/robust/utils.py
imports: import numpy
  import scipy.sparse
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: is_sparse_tensor(tensor) and returns: True, False