When I was checking function references of
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>