code: def test_SAGEConv_equality(idtype_int, max_in_degree, to_block):
      device = "cuda:0"
      in_feat, out_feat = 5, 2
      kwargs = {"aggregator_type": "mean"}
      g = generate_graph().to(device)
      if idtype_int:
          g = g.int()
      if to_block:
          g = dgl.to_block(g)
      feat = torch.rand(g.num_src_nodes(), in_feat).to(device)
  
      torch.manual_seed(0)
      conv1 = SAGEConv(in_feat, out_feat, **kwargs).to(device)
  
      torch.manual_seed(0)
      conv2 = CuGraphSAGEConv(in_feat, out_feat, **kwargs).to(device)
  
      with torch.no_grad():
          conv2.linear.weight.data[
              :, :in_feat
          ] = conv1.fc_neigh.weight.data
          conv2.linear.weight.data[
              :, in_feat:
          ] = conv1.fc_self.weight.data
          conv2.linear.bias.data[:] = conv1.fc_self.bias.data
  
      out1 = conv1(g, feat)
      out2 = conv2(g, feat, max_in_degree=max_in_degree)
      assert torch.allclose(out1, out2, atol=1e-06)
  
      grad_out = torch.rand_like(out1)
      out1.backward(grad_out)
      out2.backward(grad_out)
      assert torch.allclose(
          conv1.fc_neigh.weight.grad,
          conv2.linear.weight.grad[:, :in_feat],
          atol=1e-6,
      )
      assert torch.allclose(
          conv1.fc_self.weight.grad,
          conv2.linear.weight.grad[:, in_feat:],
          atol=1e-6,
      )
      assert torch.allclose(
          conv1.fc_self.bias.grad, conv2.linear.bias.grad, atol=1e-6
      )
  
file_path: dgl/tests/cugraph/cugraph-ops/test_cugraph_sageconv.py
imports: from collections import OrderedDict
  from itertools import product
  import dgl
  import pytest
  import torch
  from dgl.nn import CuGraphSAGEConv, SAGEConv
label_desc: Use image node_id 2 for calling a global function with example usage: test_SAGEConv_equality(idtype_int, max_in_degree, to_block) without return types