code: def test_is_sparse():
      x = torch.randn(5, 5)
  
      assert not is_sparse(x)
      assert is_sparse(x.to_sparse())
  
      if torch_geometric.typing.WITH_TORCH_SPARSE:
          assert is_sparse(SparseTensor.from_dense(x))
  
file_path: pytorch_geometric/test/utils/test_sparse.py
imports: import os.path
  import pytest
  import torch
  import torch_geometric.typing
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import is_full_test, withCUDA, withPackage
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import dense_to_sparse, is_sparse, is_torch_sparse_tensor, to_edge_index, to_torch_coo_tensor, to_torch_csc_tensor, to_torch_csr_tensor, to_torch_sparse_tensor
  from torch_geometric.utils.sparse import cat
label_desc: Use image node_id 4 for calling a global function with example usage: test_is_sparse() without return types