code: def test_neg():
      ctx = F.ctx()
      row = torch.tensor([1, 1, 3]).to(ctx)
      col = torch.tensor([1, 2, 3]).to(ctx)
      val = torch.tensor([1.0, 1.0, 2.0]).to(ctx)
      A = spmatrix(torch.stack([row, col]), val)
      neg_A = -A
      assert A.shape == neg_A.shape
      assert A.nnz == neg_A.nnz
      assert torch.allclose(-A.val, neg_A.val)
      assert torch.allclose(
          torch.stack(A.coo()), torch.stack(neg_A.coo())
      )
      assert A.val.device == neg_A.val.device
  
imports: import sys
  import backend
  import torch
  from dgl.sparse import diag, spmatrix
label_desc: Use image node_id 1 for calling a global function with example usage: test_neg() without return types