class_docstr: Upsampling over a set of 2d planes w/ indices used for max pooling.
class_docstr_tok: ["Upsampling","over","a","set","of","2d","planes","w\/","indices","used","for","max","pooling","."]
code: def forward_gpu(self, x):
      self._in_dtype = x[0].dtype
  
      xp = cuda.cupy
      n, c, h, w = x[0].shape
      if self.outh is None:
          self.outh = conv.get_deconv_outsize(
              h, self.kh, self.sy, self.ph, cover_all=self.cover_all
          )
      if self.outw is None:
          self.outw = conv.get_deconv_outsize(
              w, self.kw, self.sx, self.pw, cover_all=self.cover_all
          )
      up_y = xp.zeros(
          (n, c, self.outh, self.outw), dtype=self._in_dtype
      )
      up_y = conv.im2col_gpu(
          up_y,
          self.kh,
          self.kw,
          self.sy,
          self.sx,
          self.ph,
          self.pw,
          cover_all=self.cover_all,
      )
      up_y = up_y.transpose(0, 1, 4, 5, 2, 3)
      n, c, oy, ox, ky, kx = up_y.shape
      indexes = xp.asarray(self.indexes, dtype=numpy.int32)
      cuda.elementwise(
          "int32 index, T x, int32 n, int32 c, int32 oy, int32 ox,"
          "int32 ky, int32 kx",
          "raw T up_y",
          """
              int yn = i / c / oy / ox;
              int yc = (i / oy / ox) % c;
              int yoy = (i / ox) % oy;
              int yox = i % ox;
              up_y[yn * c * oy * ox * ky * kx +
                yc * oy * ox * ky * kx +
                yoy * ox * ky * kx +
                yox * ky * kx +
                index] = x;
              """,
          "upsampling_2d_fwd",
      )(indexes, x[0], n, c, oy, ox, ky, kx, up_y)
      up_y = up_y.transpose(0, 1, 4, 5, 2, 3)
      up_y = conv.col2im_gpu(
          up_y, self.sy, self.sx, self.ph, self.pw, self.outh, self.outw
      )
      return (up_y,)
  
imports: import numpy
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.functions.pooling import pooling_2d
  from chainer.utils import conv
  from chainer.utils import type_check
label_desc: Use image node_id 4 for calling the Upsampling2D obj's underlying member method code with example usage: obj.forward_gpu(x) and returns: up_y