[inductor] Make adaptive_max_pool2d error on int64 (#143762)

Fixes #143752

Pull Request resolved: https://github.com/pytorch/pytorch/pull/143762
Approved by: https://github.com/yanboliang
This commit is contained in:
Jason Ansel
2024-12-23 21:20:05 -08:00
committed by PyTorch MergeBot
parent 135c7db99d
commit 060ee14753
2 changed files with 24 additions and 0 deletions

View File

@ -4630,6 +4630,9 @@ fallback_adaptive_max_pool2d = fallback_handler(
@register_lowering(aten.adaptive_max_pool2d)
def adaptive_max_pool2d(x, output_size):
if x.get_dtype() == torch.int64:
# not supported in eager
raise RuntimeError("adaptive_max_pool2d not implemented for Long")
assert isinstance(x, TensorBox)
assert len(output_size) == 2
x.realize_hint()