code: def test_u_dot_v(idtype, x_size, y_size):
      ctx = F.ctx()
      g = dgl.rand_graph(30, 100)
      g = g.astype(idtype).to(ctx)
      x = torch.randn(
          (g.num_nodes(),) + x_size, requires_grad=True, device=ctx
      )
      y = torch.randn(
          (g.num_nodes(),) + y_size, requires_grad=True, device=ctx
      )
  
      z = dgl.u_dot_v(g, x, y)
      z.sum().backward()
      x_grad = x.grad
      y_grad = y.grad
  
      x_grad.zero_()
      y_grad.zero_()
      u, v = g.edges()
      x_u, y_v = pad_shape(x[u.long()], y[v.long()], x_size, y_size)
      z_true = (x_u * y_v).sum(-1).unsqueeze(-1)
      z_true.sum().backward()
      x_grad_true = x.grad
      y_grad_true = y.grad
  
      assert torch.allclose(z, z_true, atol=1e-4, rtol=1e-4)
      assert torch.allclose(x_grad, x_grad_true)
      assert torch.allclose(y_grad, y_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 7 for calling a global function with example usage: test_u_dot_v(idtype, x_size, y_size) without return types