code: def test_diag_op_diag(opname):
      op = getattr(operator, opname)
      ctx = F.ctx()
      shape = (3, 4)
      D1 = diag(torch.arange(1, 4).to(ctx), shape=shape)
      D2 = diag(torch.arange(10, 13).to(ctx), shape=shape)
      result = op(D1, D2)
      assert torch.allclose(
          result.val, op(D1.val, D2.val), rtol=1e-4, atol=1e-4
      )
      assert result.shape == D1.shape
  
file_path: dgl/tests/python/pytorch/sparse/test_elementwise_op.py
imports: import operator
  import backend
  import dgl.sparse
  import pytest
  import torch
  from dgl.sparse import diag, power
label_desc: Use image node_id 1 for calling a global function with example usage: test_diag_op_diag(opname) without return types