You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][Relax] Arithmetic on an unbatched AdaptiveAvgPool2d output fails in from_exported_program: "Please convert 2.0 with const first" #20943
AdaptiveAvgPool2d accepts an unbatched (C, H, W) input, and pool(x) * 2.0 works in eager and torch.export, so from_exported_program should convert it.
Actual behavior
The conversion fails. torch.maximum or torch.minimum of two such outputs fails with maximum(): argument 'input' (position 1) must be Tensor, not Call. AdaptiveAvgPool3d with an unbatched (C, D, H, W) input fails the same way. A batched input, or an output size of (1, 1), works.
TypeError: Please convert 2.0 with `const` first
Possibly _adaptive_avg_pool2d and _adaptive_avg_pool3d return the squeeze for an unbatched input without emitting it, so _binary_op gets a Call instead of a Var.
Environment
TVM: main @ 2bf0532 (0.28.dev0), built from source, target llvm
Is this available for me to work on? I’d investigate the unbatched pooling output handling and add CPU tests for 2D/3D pooling followed by scalar arithmetic and maximum/minimum, keeping the batched cases as controls.
AI disclosure: this request was drafted and posted with AI assistance. I would implement the fix and submit the PR myself.
Activity
GoyalIshaan commentedon Nov 9, 2026
Is this available for me to work on? I’d investigate the unbatched pooling output handling and add CPU tests for 2D/3D pooling followed by scalar arithmetic and maximum/minimum, keeping the batched cases as controls.
AI disclosure: this request was drafted and posted with AI assistance. I would implement the fix and submit the PR myself.