code: def test_transformerconv(
      beta,
      bipartite_node_feats,
      concat,
      idtype_int,
      num_heads,
      to_block,
      use_edge_feats,
      sparse_format,
  ):
      torch.manual_seed(12345)
      device = "cuda"
      g = create_graph1().to(device)
  
      if idtype_int:
          g = g.int()
  
      if to_block:
          g = dgl.to_block(g)
  
      size = (g.num_src_nodes(), g.num_dst_nodes())
      if sparse_format == "coo":
          sg = SparseGraph(
              size=size,
              src_ids=g.edges()[0],
              dst_ids=g.edges()[1],
              formats="csc",
          )
      elif sparse_format == "csc":
          offsets, indices, _ = g.adj_tensors("csc")
          sg = SparseGraph(
              size=size,
              src_ids=indices,
              cdst_ids=offsets,
              formats="csc",
          )
  
      if bipartite_node_feats:
          in_node_feats = (5, 3)
          nfeat = (
              torch.rand(
                  g.num_src_nodes(), in_node_feats[0], device=device
              ),
              torch.rand(
                  g.num_dst_nodes(), in_node_feats[1], device=device
              ),
          )
      else:
          in_node_feats = 3
          nfeat = torch.rand(
              g.num_src_nodes(), in_node_feats, device=device
          )
      out_node_feats = 2
  
      if use_edge_feats:
          edge_feats = 3
          efeat = torch.rand(g.num_edges(), edge_feats, device=device)
      else:
          edge_feats = None
          efeat = None
  
      conv = TransformerConv(
          in_node_feats,
          out_node_feats,
          num_heads=num_heads,
          concat=concat,
          beta=beta,
          edge_feats=edge_feats,
      ).to(device)
  
      if sparse_format is not None:
          out = conv(sg, nfeat, efeat)
      else:
          out = conv(g, nfeat, efeat)
  
      grad_out = torch.rand_like(out)
      out.backward(grad_out)
  
imports: import pytest
  from cugraph_dgl.nn.conv.base import SparseGraph
  from cugraph_dgl.nn import TransformerConv
  from .common import create_graph1
label_desc: Use image node_id 1 for calling a global function with example usage: test_transformerconv(beta, bipartite_node_feats, concat, idtype_int, num_heads, to_block, use_edge_feats, sparse_format) without return types