code: def test_batch_setter_autograd(idtype):
      g = generate_graph(idtype, grad=True)
      h1 = g.ndata["h"]
      # partial set
      v = F.tensor([1, 2, 8], g.idtype)
      hh = F.attach_grad(F.zeros((len(v), D)))
      with F.record_grad():
          g.nodes[v].data["h"] = hh
          h2 = g.ndata["h"]
          F.backward(h2, F.ones((10, D)) * 2)
      assert F.array_equal(
          F.grad(h1)[:, 0],
          F.tensor([2.0, 0.0, 0.0, 2.0, 2.0, 2.0, 2.0, 2.0, 0.0, 2.0]),
      )
      assert F.array_equal(F.grad(hh)[:, 0], F.tensor([2.0, 2.0, 2.0]))
  
imports: import warnings
  from collections import defaultdict
  import backend
  import dgl
  import networkx
  import numpy
  from utils import parametrize_idtype
label_desc: Use image node_id 8 for calling a global function with example usage: test_batch_setter_autograd(idtype) without return types