code: def _compile_loop(self, out_xs):
      # 2D: int in_x0_0 = max(0,   out_x_0 * s_0       - p_0);
      #     int in_x1_0 = min(d_0, out_x_0 * s_0 + k_0 - p_0);
      #     int in_x0_1 = max(0,   out_x_1 * s_1       - p_1);
      #     int in_x1_1 = min(d_1, out_x_1 * s_1 + k_1 - p_1);
      #     ... Before-part here ...
      #     for (int x_0 = in_x0_0; x_0 < in_x1_0; ++x_0) {
      #       int offset_0 = d_1 * (x_0 + d_0 * c0);
      #       for (int x_1 = in_x0_1; x_1 < in_x1_1; ++x_1) {
      #         int offset_1 = 1 * (x_1 + offset_0);
      #         ... Main-part here ...
      #       }
      #     }
      #     ... After-part here ...
      def aux(in_x0, in_x1, d, out, k, s, p):
          return [
              "int {} = max(0, {} * {} - {});".format(in_x0, out, s, p),
              "int {} = min({}, {} * {} + {} - {});".format(
                  in_x1, d, out, s, k, p
              ),
          ]
  
      in_x0s = conv_nd_kernel.vars("in_x0", self.ndim)
      in_x1s = conv_nd_kernel.vars("in_x1", self.ndim)
      bounds = sum(
          conv_nd_kernel.map_(
              aux,
              in_x0s,
              in_x1s,
              self.ds,
              out_xs,
              self.ks,
              self.ss,
              self.ps,
          ),
          [],
      )
  
      def _loop_main(main):
          w = conv_nd_kernel.Writer()
  
          # Loop openings.
          xs = conv_nd_kernel.vars("x", self.ndim)
          offsets = conv_nd_kernel.vars("offset", self.ndim)
          ds1 = self.ds[1:] + [1]
          offsets1 = ["d_0 * c0"] + offsets[:-1]
          for x, in_x0, in_x1, offset, offset1, d1 in moves.zip(
              xs, in_x0s, in_x1s, offsets, offsets1, ds1
          ):
              w.write(
                  "for (int {} = {}; {} < {}; ++{}) {{".format(
                      x, in_x0, x, in_x1, x
                  ),
                  "inc",
              )
              w.write(
                  "int {} = {} * ({} + {});".format(
                      offset, d1, x, offset1
                  )
              )
  
          # Write main-part.
          offset = offsets[-1]
          for l in main(offset, xs).split("\n"):
              w.write(l)
  
          # Loop closings.
          for _ in xs:
              w.write("}", "dec")
  
          return [w.get()]
  
      return bounds, _loop_main
  
imports: from six import moves
  from chainer.backends import cuda
  from chainer.utils import conv_nd_kernel
label_desc: Use image node_id 13 for calling the PoolingNDKernelForward obj's underlying member method code with example usage: obj._compile_loop(out_xs) and returns: bounds,  _loop_main, list, list