Module Import alias ImportFrom alias ImportFrom alias ImportFrom alias If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword UnaryOpUSub Call NameLoad Str keyword AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMult NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr keyword Num Return TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad NameLoad keyword AttributeLoad SubscriptLoad NameLoad Index Num attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr Expr Call Call AttributeLoad NameLoad attr Str Str Str Str Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Slice Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Num NameLoad NameLoad Num For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad Return TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Slice Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Num Expr Call Call AttributeLoad NameLoad attr Str Str Str Str Call AttributeLoad SubscriptLoad NameLoad Index Num attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad NameLoad body Expr Str Return Call Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list
N/A N/A numpy chainer cuda chainer.functions.pooling pooling_2d chainer.utils conv N/A N/A cuda cudnn_enabled N/A N/A cudnn N/A cuda cudnn N/A libcudnn N/A cudnn cudnn MaxPooling2D N/A N/A pooling_2d Pooling2D N/A N/A Max pooling over a set of 2d planes. forward_cpu N/A N/A self x N/A N/A N/A col N/A N/A conv im2col_cpu N/A x N/A 0 N/A self kh N/A self kw N/A self sy N/A self sx N/A self ph N/A self pw pval N/A N/A float inf cover_all N/A self cover_all N/A N/A n c kh kw out_h out_w N/A col shape N/A col N/A N/A col reshape n c N/A kh kw out_h out_w N/A N/A self indexes N/A N/A col argmax axis 2 N/A y N/A N/A col max axis 2 N/A N/A y N/A forward_gpu N/A N/A self x N/A N/A N/A N/A N/A cuda cudnn_enabled N/A self use_cudnn N/A N/A N/A N/A N/A super MaxPooling2D self forward_gpu x N/A N/A n c h w N/A N/A x N/A 0 shape N/A y_h N/A N/A conv get_conv_outsize h N/A self kh N/A self sy N/A self ph N/A self cover_all N/A y_w N/A N/A conv get_conv_outsize w N/A self kw N/A self sx N/A self pw N/A self cover_all N/A y N/A N/A N/A cuda cupy empty N/A n c y_h y_w dtype N/A N/A x N/A 0 dtype N/A N/A self indexes N/A N/A N/A cuda cupy empty N/A n c y_h y_w dtype N/A numpy int32 N/A N/A N/A N/A cuda elementwise raw T in, int32 h, int32 w, int32 out_h, int32 out_w,int32 kh, int32 kw, int32 sy, int32 sx, int32 ph, int32 pw T out, S indexes 
               int c0    = i / (out_h * out_w);
               int out_y = i / out_w % out_h;
               int out_x = i % out_w;
               int in_y_0 = max(0, out_y * sy - ph);
               int in_y_1 = min(h, out_y * sy + kh - ph);
               int in_x_0 = max(0, out_x * sx - pw);
               int in_x_1 = min(w, out_x * sx + kw - pw);

               T maxval = in[in_x_0 + w * (in_y_0 + h * c0)];
               int argmax_y = in_y_0;
               int argmax_x = in_x_0;
               for (int y = in_y_0; y < in_y_1; ++y) {
                 int offset_y = w * (y + h * c0);
                 for (int x = in_x_0; x < in_x_1; ++x) {
                   float v = in[x + offset_y];
                   if (maxval < v) {
                     maxval   = v;
                     argmax_y = y;
                     argmax_x = x;
                   }
                 }
               }
               out = maxval;

               int argmax_ky = argmax_y + ph - out_y * sy;
               int argmax_kx = argmax_x + pw - out_x * sx;
               indexes = argmax_kx + kw * argmax_ky;
             max_pool_fwd N/A N/A N/A x N/A 0 reduced_view h w y_h y_w N/A self kh N/A self kw N/A self sy N/A self sx N/A self ph N/A self pw y N/A self indexes N/A N/A y N/A backward_cpu N/A N/A self x gy N/A N/A N/A N/A n c out_h out_w N/A N/A gy N/A 0 shape N/A N/A h w N/A N/A N/A x N/A 0 shape N/A 2 N/A gcol N/A N/A numpy zeros N/A n c N/A self kh N/A self kw out_h out_w dtype N/A numpy float32 N/A gcol_r N/A N/A numpy rollaxis N/A N/A gcol reshape n c -1 out_h out_w 2 N/A i N/A N/A numpy ndindex n c out_h out_w N/A N/A N/A N/A gcol_r N/A N/A N/A self indexes N/A i N/A i N/A N/A gy N/A 0 N/A i N/A gx N/A N/A conv col2im_cpu gcol N/A self sy N/A self sx N/A self ph N/A self pw h w N/A N/A gx N/A backward_gpu N/A N/A self x gy N/A N/A N/A N/A N/A cuda cudnn_enabled N/A self use_cudnn N/A N/A N/A N/A N/A super MaxPooling2D self backward_gpu x gy N/A N/A n c h w N/A N/A x N/A 0 shape N/A N/A y_h y_w N/A N/A N/A gy N/A 0 shape N/A 2 N/A gx N/A N/A N/A cuda cupy empty_like N/A x N/A 0 N/A N/A N/A N/A cuda elementwise raw T gy, raw S indexes, int32 h, int32 w,int32 out_h, int32 out_w, int32 kh, int32 kw,int32 sy, int32 sx, int32 ph, int32 pw T gx 
               int c0 = i / (h * w);
               int y  = i / w % h + ph;
               int x  = i % w + pw;
               int out_y_0 = max(0,     (y - kh + sy) / sy);
               int out_y_1 = min(out_h, (y      + sy) / sy);
               int out_x_0 = max(0,     (x - kw + sx) / sx);
               int out_x_1 = min(out_w, (x      + sx) / sx);

               T val = 0;
               for (int out_y = out_y_0; out_y < out_y_1; ++out_y) {
                 int ky = y - out_y * sy;
                 for (int out_x = out_x_0; out_x < out_x_1; ++out_x) {
                   int kx = x - out_x * sx;
                   int offset = out_x + out_w * (out_y + out_h * c0);
                   if (indexes[offset] == kx + kw * ky) {
                     val += gy[offset];
                   }
                 }
               }
               gx = val;
             max_pool_bwd N/A N/A N/A gy N/A 0 reduced_view N/A N/A N/A self indexes reduced_view h w y_h y_w N/A self kh N/A self kw N/A self sy N/A self sx N/A self ph N/A self pw gx N/A N/A gx N/A create_pool_desc N/A N/A self N/A N/A N/A N/A N/A cudnn create_pooling_descriptor N/A N/A self kh N/A self kw N/A N/A self sy N/A self sx N/A N/A self ph N/A self pw N/A libcudnn CUDNN_POOLING_MAX N/A N/A max_pooling_2d N/A N/A x ksize stride pad cover_all use_cudnn N/A None 0 True True N/A N/A Spatial max pooling function.

    This function acts similarly to :class:`~functions.Convolution2D`, but
    it computes the maximum of input spatial patch for each channel
    without any parameter instead of computing the inner products.

    Args:
        x (~chainer.Variable): Input variable.
        ksize (int or pair of ints): Size of pooling window. ``ksize=k`` and
            ``ksize=(k, k)`` are equivalent.
        stride (int or pair of ints or None): Stride of pooling applications.
            ``stride=s`` and ``stride=(s, s)`` are equivalent. If ``None`` is
            specified, then it uses same stride as the pooling window size.
        pad (int or pair of ints): Spatial padding width for the input array.
            ``pad=p`` and ``pad=(p, p)`` are equivalent.
        cover_all (bool): If ``True``, all spatial locations are pooled into
            some output pixels. It may make the output size larger.
        use_cudnn (bool): If ``True`` and cuDNN is enabled, then this function
            uses cuDNN as the core implementation.

    Returns:
        ~chainer.Variable: Output variable.

     N/A N/A N/A MaxPooling2D ksize stride pad cover_all use_cudnn x N/A