class_docstr: Implement the max and average pooling on the gpu.
class_docstr_tok: ["Implement","the","max","and","average","pooling","on","the","gpu","."]
code: def R_op(self, inputs, eval_points):
      if self.mode != "max":
          # Rop for average or sum is simply pooling evaluated at eval point
          eval_inputs = [eval_points[0]] + inputs[1:]
          return [self(*eval_inputs)]
  
      # R_op can receive None as eval_points.
      # That mean there is no diferientiable path through that input
      # If this imply that you cannot compute some outputs,
      # return None for those.
      if eval_points[0] is None:
          return [None]
      z = self(*inputs)
      x, ws, stride, pad = inputs
      return [
          GpuDownsampleFactorMaxGradGrad(
              self.ignore_border, self.mode, self.ndim
          )(x, z, eval_points[0], ws, stride, pad)
      ]
  
imports: from __future__ import absolute_import, print_function, division
  import theano
  from theano import Apply
  from theano.gof import ParamsType
  from theano.scalar import bool
  from theano.tensor.basic import as_tensor_variable
  from theano.tensor.signal.pool import Pool, PoolingMode_t
  from .type import gpu_context_type
  from .basic_ops import CGpuKernelBase, infer_context_name, gpuarray_helper_inc_dir, as_gpuarray_variable, gpu_contiguous
label_desc: Use image node_id 9 for calling the GpuPool obj's underlying member method code with example usage: obj.R_op(inputs, eval_points) and returns: list, list, list