code: def backward(self, indices, grad_outputs):
      inputs = self.get_retained_inputs()
      (g,) = grad_outputs
  
      fwd_in_subs = self.in_subs.split(",")
      fwd_out_sub = self.out_sub
      return tuple(
          DiagEinSum(
              in_subs=",".join(
                  [
                      (fwd_out_sub if j == i else s)
                      for j, s in enumerate(fwd_in_subs)
                  ]
              ),
              out_sub=fwd_in_subs[i],
              out_shape=inputs[i].shape,
          ).apply(
              tuple((g if j == i else x) for j, x in enumerate(inputs))
          )[
              0
          ]
          for i in indices
      )
  
imports: import warnings
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer import utils
  from chainer.utils import argument
  from chainer.utils import type_check
label_desc: Use image node_id 4 for calling the EinSum obj's underlying member method code with example usage: obj.backward(indices, grad_outputs) and returns: tuple