Files
apache--tvm/python
as4230 bfa07828a6 [BugFix][Relax] Add legalize for isnan, isinf, isfinite (#19492)
The Relax ops `relax.isnan`, `relax.isinf`, and `relax.isfinite` are
registered in the op registry and emit valid IR, but lack FLegalize
entries so LegalizeOps() leaves them unlowered and relax.build() crashes
at codegen with:

    InternalError: CodeGenVM cannot handle this intrinsic now:
    Op(relax.isnan)

Same crash on `isinf` and `isfinite`, on both LLVM and CUDA targets.

The TOPI implementations already exist (python/tvm/topi/math.py). The
fix is three register_legalize calls following the
_call_topi_without_attr pattern used by the other unary ops in the same
file.

Fixes #19452.
2026-05-02 17:56:33 +08:00
..