About error module 'torch._inductor' has no attribute 'lowering'

AttributeError: module ‘torch._inductor’ has no attribute ‘lowering’

torch/_inductor/decomposition.py:728

  if (
        torch._inductor.lowering.should_fallback_max_pool2d_with_indices(
            kernel_size, dilation
        )
        or window_size > torch.iinfo(torch.int8).max
    ):

What i should do?

import the needed namespace:

import torch

torch._inductor.lowering.should_fallback_max_pool2d_with_indices
# AttributeError: module 'torch._inductor' has no attribute 'lowering'

import torch._inductor.lowering
torch._inductor.lowering.should_fallback_max_pool2d_with_indices
# <function torch._inductor.lowering.should_fallback_max_pool2d_with_indices(kernel_size, dilation)>