code: def test_copy_u(idtype, feat_size):
      ctx = F.ctx()
      g = dgl.rand_graph(30, 100)
      g = g.astype(idtype).to(ctx)
      x = torch.randn(
          (g.num_nodes(),) + feat_size, requires_grad=True, device=ctx
      )
  
      y = dgl.copy_u(g, x)
      y.sum().backward()
      x_grad = x.grad
  
      x.grad.zero_()
      u, v = g.edges()
      y_true = x[u.long()]
      y_true.sum().backward()
      x_grad_true = x.grad
  
      assert torch.allclose(y, y_true)
      assert torch.allclose(x_grad, x_grad_true)
  
file_path: dgl/tests/python/pytorch/mpops/test_edgewise.py
imports: import random
  import backend
  import dgl
  import numpy
  import pytest
  import torch
  from utils import parametrize_idtype
label_desc: Use image node_id 1 for calling a global function with example usage: test_copy_u(idtype, feat_size) without return types