Rate this Page

torch.fx.experimental.graph_gradual_typechecker.maxpool2d_inference_rule#

torch.fx.experimental.graph_gradual_typechecker.maxpool2d_inference_rule(n, module_instance)[source]#

Given a MaxPool2D instance and a node check the following conditions:

  • Input size matches size 3 or 4

  • Current node type is consistent with the output type we will calculate

  • Input size matches output size and the last two dimensions of the output are w_out and h_out. The remaining dimensions are the same as the input

  • Our final result is the greatest upper bound of the output we calculate and the current node type.

Return type:

Any