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] interpolate(mode="bilinear", align_corners=True) to an output size of 1 fails in tvm.compile: "Divide by zero" #20941
With align_corners=True and an output size of 1 along an axis, PyTorch samples the first input element along that axis. It works in eager and torch.export, so tvm.compile should build it.
Actual behavior
tvm.compile fails. The same happens for an output size of (6, 1) or (1, 1), and for a scale_factor that gives an output size of 1 (e.g. an input height of 1 with scale_factor=1.5). align_corners=False, or output sizes larger than 1, work.
eager: torch.Size([1, 1, 1, 6])
RuntimeError: Check failed: fb->value != 0 (0 vs. 0) : Divide by zero
Possibly get_inx in topi/image/resize.py divides by target_width - 1 in the align_corners mode, without the size-one guard that the pytorch_half_pixel mode has.
Environment
TVM: main @ 2bf0532 (0.28.dev0), built from source, target llvm
Activity