Strange function type named “boolean_dispatch..fn” for torch.nn.functional.max_pool2d
When I was checking function references of functional.relu, functional.avg_pool2d or functional.max_pool2d, I found description of max_pool2d is a bit different from other function types. This name ‘boolean_dispatch’ may be a bit confusing.
See the python command lines as follows:
>>> import torch
>>> func1 = torch.nn.functional.max_pool2d
>>> func2 = torch.nn.functional.avg_pool2d
>>> func3 = torch.nn.functional.relu
>>> func1
<function boolean_dispatch.<locals>.fn at 0x7f3e99f928c0>
>>> func2
<built-in function avg_pool2d>
>>> func3
<function relu at 0x7f3e99f97ef0>


python version: 3.7

torch version: 1.10