def __init__(self, window_size, stride=None, padding=None, mode='max'):
        df.Module.__init__(self)
        if mode == 'avg':
            mode = 'average_exc_pad'
        self.window_size = window_size
        self.mode = mode

        # Catch a probably common bug while we transition the API.
        assert isinstance(window_size, (list, tuple)), "New pooling API: window_size needs to be a tuple!"

        if stride is None:
            self.stride = window_size
        else:
            self.stride = stride

        if padding is None:
            self.padding = (0,)*len(window_size)
        else:
            self.padding = padding
Return a weak-reference-like instance for a bound method
dataset/ETHPy150Open lucasb-eyer/DeepFried2/DeepFried2/layers/PoolingCUDNN.py/PoolingCUDNN.__init__--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/dispatch/saferef.py/BoundMethodWeakref.__init__