code: def test_to_torch_csc_tensor():
      edge_index = torch.tensor(
          [
              [0, 1, 1, 2, 2, 3],
              [1, 0, 2, 1, 3, 2],
          ]
      )
  
      adj = to_torch_csc_tensor(edge_index)
      assert adj.size() == (4, 4)
      assert adj.layout == torch.sparse_csc
      adj_coo = adj.to_sparse_coo().coalesce()
      if torch_geometric.typing.WITH_PT20:
          assert torch.allclose(adj_coo.indices(), edge_index)
      else:
          assert torch.allclose(adj_coo.indices().flip([0]), edge_index)
  
      edge_weight = torch.randn(edge_index.size(1))
      adj = to_torch_csc_tensor(edge_index, edge_weight)
      assert adj.size() == (4, 4)
      assert adj.layout == torch.sparse_csc
      adj_coo = adj.to_sparse_coo().coalesce()
      if torch_geometric.typing.WITH_PT20:
          assert torch.allclose(adj_coo.indices(), edge_index)
          assert torch.allclose(adj_coo.values(), edge_weight)
      else:
          perm = adj_coo.indices()[0].argsort()
          assert torch.allclose(adj_coo.indices()[:, perm], edge_index)
          assert torch.allclose(adj_coo.values()[perm], edge_weight)
  
      if torch_geometric.typing.WITH_PT20:
          edge_attr = torch.randn(edge_index.size(1), 8)
          adj = to_torch_csc_tensor(edge_index, edge_attr)
          assert adj.size() == (4, 4, 8)
          assert adj.layout == torch.sparse_csc
          assert torch.allclose(
              adj.to_sparse_coo().coalesce().indices(), edge_index
          )
          assert torch.allclose(
              adj.to_sparse_coo().coalesce().values(), edge_attr
          )
  
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 7 for calling a global function with example usage: test_to_torch_csc_tensor() without return types