The GitHub Actions job "Lint" on tvm.git/main has succeeded.
Run started by GitHub user tlopex (triggered by tlopex).

Head commit for run:
2bc2db236d05daedda9674596755a31555cabdb3 / T1Gang 
<[email protected]>
[Relax][ONNX] Preserve bool dtype when folding constant comparisons (#20286)

Fixes #20282.

The ONNX frontend constant-folds binary operators with NumPy. When both
operands have the same dtype, the result was unconditionally cast back
to
the operand dtype to avoid NumPy precision widening.

This is correct for arithmetic operations, but incorrect for comparison
operators such as `Less`, `LessOrEqual`, `Greater`, and
`GreaterOrEqual`,
whose result dtype must be `bool`.

As a result, constant-folded comparisons produced correct 0/1 values but
returned `int32` or `float32` tensors instead of `bool`.

This patch preserves NumPy boolean results while keeping the existing
no-widening behavior for non-boolean binary operations.

Tests:
- Added regression coverage for constant-folded ONNX comparisons with
  `int32` and `float32` operands.
- The 8 new cases fail before the fix and pass after it.
- Related ONNX binary tests: 16 passed.
- `git diff --check upstream/main..HEAD`: passed.

Report URL: https://github.com/apache/tvm/actions/runs/34186407302

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to