code: def test_sum_case1(idtype):
      # NOTE: If you want to update this test case, remember to update the docstring
      #  example too!!!
      g1 = dgl.graph(([0, 1], [1, 0]), idtype=idtype, device=F.ctx())
      g1.ndata["h"] = F.tensor([1.0, 2.0])
      g2 = dgl.graph(([0, 1], [1, 2]), idtype=idtype, device=F.ctx())
      g2.ndata["h"] = F.tensor([1.0, 2.0, 3.0])
      bg = dgl.batch([g1, g2])
      bg.ndata["w"] = F.tensor([0.1, 0.2, 0.1, 0.5, 0.2])
      assert F.allclose(F.tensor([3.0]), dgl.sum_nodes(g1, "h"))
      assert F.allclose(F.tensor([3.0, 6.0]), dgl.sum_nodes(bg, "h"))
      assert F.allclose(
          F.tensor([0.5, 1.7]), dgl.sum_nodes(bg, "h", "w")
      )
  
file_path: dgl/tests/python/common/test_readout.py
imports: import unittest
  import backend
  import dgl
  import networkx
  import numpy
  import pytest
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases
label_desc: Use image node_id 1 for calling a global function with example usage: test_sum_case1(idtype) without return types