code: def _compile_loop(self, xs):
      # 2D: int out_x0_0 = max(0,     (x_0 - k_0 + s_0) / s_0);
      #     int out_x1_0 = min(out_0, (x_0       + s_0) / s_0);
      #     int out_x0_1 = max(0,     (x_1 - k_1 + s_1) / s_1);
      #     int out_x1_1 = min(out_1, (x_1       + s_1) / s_1);
      #     ... Before-part here ...
      #     for (int out_x_0 = out_x0_0; out_x_0 < out_x1_0; ++out_x_0) {
      #       int offset_0 = out_1 * (out_x_0 + out_0 * c0);
      #       for (int out_x_1 = out_x0_1; out_x_1 < out_x1_1; ++out_x_1) {
      #         int offset_1 = 1 * (out_x_1 + offset_0);
      #         ... Main-part here ...
      #       }
      #     }
      #     ... After-part here ...
      def aux(out_x0, out_x1, x, out, k, s):
          return [
              "int {} = max(0, ({} - {} + {}) / {});".format(
                  out_x0, x, k, s, s
              ),
              "int {} = min({}, ({} + {}) / {});".format(
                  out_x1, out, x, s, s
              ),
          ]
  
      out_x0s = conv_nd_kernel.vars("out_x0", self.ndim)
      out_x1s = conv_nd_kernel.vars("out_x1", self.ndim)
      bounds = sum(
          conv_nd_kernel.map_(
              aux, out_x0s, out_x1s, xs, self.outs, self.ks, self.ss
          ),
          [],
      )
  
      def _loop_main(main):
          w = conv_nd_kernel.Writer()
  
          # Loop openings.
          out_xs = conv_nd_kernel.vars("out_x", self.ndim)
          offsets = conv_nd_kernel.vars("offset", self.ndim)
          outs1 = self.outs[1:] + [1]
          offsets1 = ["out_0 * c0"] + offsets[:-1]
          for out_x, out_x0, out_x1, offset, offset1, out1 in moves.zip(
              out_xs, out_x0s, out_x1s, offsets, offsets1, outs1
          ):
              w.write(
                  "for (int {} = {}; {} < {}; ++{}) {{".format(
                      out_x, out_x0, out_x, out_x1, out_x
                  ),
                  "inc",
              )
              w.write(
                  "int {} = {} * ({} + {});".format(
                      offset, out1, out_x, offset1
                  )
              )
  
          # Write main-part.
          offset = offsets[-1]
          for l in main(offset, xs, out_xs).split("\n"):
              w.write(l)
  
          # Loop closings.
          for _ in out_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 PoolingNDKernelBackward obj's underlying member method code with example usage: obj._compile_loop(xs) and returns: bounds,  _loop_main, list, list