code: def testMultiLayerSubOps(self):
      # x1
      #   \
      #    -->Sub-->x4
      #   /           \
      # x2             -->Sub-->x6
      #   \           /
      #    -->Sub-->x5
      #   /
      # x3
      #
      # Expected gradient graph:
      #
      #  x2_g<--Sum<-----x6_g
      #          |         |
      #           <--------
      net = core.Net("test_net")
      net.Sub(["x1", "x2"], "x4")
      net.Sub(["x2", "x3"], "x5")
      net.Sub(["x4", "x5"], "x6")
      input_to_grad = net.AddGradientOperators({"x6": "x6_grad"})
      sum_op = net.Proto().op[-1]
      self.assertEqual(sum_op.input[0], "x2_grad")
      self.assertEqual(sum_op.input[1], "_x2_grad_autosplit_0")
      self.assertEqual(sum_op.output[0], "x2_grad")
      self.assertEqual(input_to_grad["x1"], "x1_grad")
      self.assertEqual(input_to_grad["x2"], "x2_grad")
      self.assertEqual(input_to_grad["x3"], "x3_grad")
  
imports: from hypothesis import given, settings
  import hypothesis.strategies
  import unittest
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, test_util, workspace
  from caffe2.python.core import CreateOperator, GradientRegistry, IR
  import numpy
label_desc: Use image node_id 8 for calling the TestGradientsAccumulationWithPassThroughGradients obj's underlying member method code with example usage: obj.testMultiLayerSubOps() without return types