I did gradient check on maxpooling2d and got returned False.
The code is as below:
from torch.autograd import Variable
import torch
from torch.autograd import gradcheck
import numpy as np
import torch
import torch.nn.functional as F


if __name__ == '__main__':
    # type maxpool 2d:

    kernel_size = 2
    n_channel = 100
    feature_size = 6
    batch_size = 3
    input = (Variable(torch.FloatTensor(torch.randn(1, n_channel, feature_size, feature_size)), requires_grad=True), kernel_size)
    f_max_pooling = F.max_pool2d
    print gradcheck(f_max_pooling, input, eps=1e-3)

If I set the eps as default, it will always return False, if I set it to 1e-3, it sometimes returns False. Any idea why?