Location of fractional max pooling implementation

I see that PyTorch functional returns

torch._C._nn.fractional_max_pool2d(input, kernel_size, output_size, _random_samples)

However, I am not finding the location of the file that has the implementation of fractional max_pooling. Could someone tell me where it is located and the reasoning of this implementation?

There are files aten/src/ATen/native/FractionalMaxPool2d.cpp and aten/src/ATen/native/cuda/FractionalMaxPool2d.cu.
In general, I would recommend rgrep on thesource tree to find functions.
Functions are then exposed to Python by a few layers of magic.

Best regards

Thomas

1 Like

Thank you @tom :slight_smile: