code: def test_gcn_norm_gradient(requires_grad, layout):
      edge_index = torch.tensor(
          [[0, 0, 0, 1, 2, 3], [1, 2, 3, 0, 0, 0]]
      )
      edge_weight = torch.ones(
          edge_index.size(1), requires_grad=requires_grad
      )
      adj = to_torch_coo_tensor(edge_index, edge_weight)
      if layout == torch.sparse_csr:
          adj = adj.to_sparse_csr()
  
      # TODO Sparse CSR tensor doesn't inherit `requires_grad` for PyTorch < 2.1.
      if layout == torch.sparse_csr and not WITH_PT21:
          assert not gcn_norm(adj)[0].requires_grad
      else:
          assert adj.requires_grad == gcn_norm(adj)[0].requires_grad
  
file_path: pytorch_geometric/test/nn/conv/test_gcn_conv.py
imports: import pytest
  import torch
  import torch_geometric.typing
  from torch_geometric.nn import GCNConv
  from torch_geometric.nn.conv.gcn_conv import gcn_norm
  from torch_geometric.testing import is_full_test
  from torch_geometric.typing import WITH_PT21, SparseTensor
  from torch_geometric.utils import to_torch_coo_tensor, to_torch_csc_tensor
label_desc: Use image node_id 7 for calling a global function with example usage: test_gcn_norm_gradient(requires_grad, layout) without return types