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 __init__(self, ignore_border, mode="max", ndim=2):
      self.ndim = ndim
      self.ignore_border = ignore_border
      if mode == "average":
          mode = "average_inc_pad"
      self.mode = mode
      CGpuKernelBase.__init__(
          self, ["c_code/pool.c"], "APPLY_SPECIFIC(pool)"
      )
      assert PoolingMode_t.has_alias(self.mode)
      assert self.ndim in [2, 3]
  
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 1 to create a new GpuPool object from inherited base classes: CGpuKernelBase with example: obj = GpuPool(ignore_border, mode, ndim)