class_docstr: Implement the grad of downsample with max on the gpu.
class_docstr_tok: ["Implement","the","grad","of","downsample","with","max","on","the","gpu","."]
code: def make_node(self, inp, out, out_grad, ws, stride=None, pad=None):
      ctx_name = infer_context_name(inp, out, out_grad)
      nd = self.ndim
      inp = as_gpuarray_variable(inp, ctx_name)
      assert inp.ndim == nd + 2
      out = as_gpuarray_variable(out, ctx_name)
      assert out_grad.ndim == nd + 2
      out_grad = as_gpuarray_variable(out_grad, ctx_name)
      assert out.ndim == nd + 2
  
      assert out_grad.ndim == inp.ndim
      assert inp.ndim == out.ndim
  
      if stride is None:
          stride = ws
      if pad is None:
          pad = (0,) * nd
      ws = as_tensor_variable(ws)
      stride = as_tensor_variable(stride)
      pad = as_tensor_variable(pad)
      assert ws.ndim == stride.ndim and ws.ndim == pad.ndim
      assert ws.ndim == 1
      if ws.dtype not in theano.tensor.int_dtypes:
          raise TypeError("Window shape parameters must be ints.")
      if stride.dtype not in theano.tensor.int_dtypes:
          raise TypeError("Stride parameters must be ints.")
      if pad.dtype not in theano.tensor.int_dtypes:
          raise TypeError("Padding parameters must be ints.")
  
      ws = theano.tensor.cast(ws, "int64")
      stride = theano.tensor.cast(stride, "int64")
      pad = theano.tensor.cast(pad, "int64")
  
      return Apply(
          self, [inp, out, out_grad, ws, stride, pad], [inp.type()]
      )
  
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 4 for calling the GpuDownsampleFactorMaxGradGrad obj's underlying member method code with example usage: obj.make_node(inp, out, out_grad, ws, stride, pad) and returns: Apply