code: def _backward(self, inputs, grad_outputs):
      (theta,) = inputs
      (ggrid,) = grad_outputs
      H, W = self.output_shape
      B, _, _ = theta.shape
      xp = backend.get_array_module(theta)
  
      ys, xs = xp.meshgrid(
          xp.linspace(-1, 1, H, dtype=theta.dtype),
          xp.linspace(-1, 1, W, dtype=theta.dtype),
          indexing="ij",
          copy=False,
      )
  
      coords = xp.concatenate(
          [xs[None], ys[None], xp.ones((1, H, W), dtype=theta.dtype)],
          axis=0,
      )
      coords_T = coords.reshape(3, H * W).transpose(1, 0)
      ggrid = ggrid.reshape(B, 2, H * W)
      gtheta = ggrid.dot(coords_T).reshape(B, 2, 3)
      return (gtheta,)
  
file_path: chainer/chainer/functions/array/spatial_transformer_grid.py
imports: import numpy
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function
  from chainer.utils import argument
  from chainer.utils import type_check
label_desc: Use image node_id 8 for calling the SpatialTransformerGrid obj's underlying member method code with example usage: obj._backward(inputs, grad_outputs) and returns: gtheta