code: def forward_gpu(self, inputs):
      if not chainer.should_use_cudnn(">=auto", 5000):
          return self._forward(inputs)
      x, grid = inputs
      out_shape = x.shape[:2] + grid.shape[2:]
      y = cuda.cupy.empty(out_shape, dtype=x.dtype)
      shape = numpy.array(out_shape, dtype=numpy.int32)
      x = cuda.cupy.ascontiguousarray(x)
      grid_t = cuda.cupy.transpose(grid, (0, 2, 3, 1))
      grid_t = cuda.cupy.ascontiguousarray(grid_t)
  
      handle = cudnn.get_handle()
      x_desc = cudnn.create_tensor_descriptor(x)
      y_desc = cudnn.create_tensor_descriptor(y)
  
      self.st_desc = (
          cuda.cupy.cudnn.create_spatial_transformer_descriptor(
              _sampler_type, grid.dtype, len(shape), shape.ctypes.data
          )
      )
  
      dtype = (
          numpy.float64 if x.dtype == numpy.float64 else numpy.float32
      )
      one = numpy.array(1, dtype=dtype).ctypes
      zero = numpy.array(0, dtype=dtype).ctypes
      libcudnn.spatialTfSamplerForward(
          handle,
          self.st_desc.value,
          one.data,
          x_desc.value,
          x.data.ptr,
          grid_t.data.ptr,
          zero.data,
          y_desc.value,
          y.data.ptr,
      )
      return (y,)
  
file_path: chainer/chainer/functions/array/spatial_transformer_sampler.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 3 for calling the SpatialTransformerSampler obj's underlying member method code with example usage: obj.forward_gpu(inputs) and returns: y, self