[Bug] [Relay] [Torch] [ONNX] Robustness of Cast
operator accepting NaN
values
#17081
Labels
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type: bug
Description
Here is a single op:
Cast
In TVM, when it accepts NaN value, it outputs False.
However, in
PyTorch
, it outputs True.In Pytorch and ONNX,
Cast
would cast theNonzero value
to False, the others to True.The evidence is here: https://onnx.ai/onnx/operators/onnx__Cast.html#l-onnx-doc-cast
I am unsure how the
Cast
op is defined in TVM. But if it is different from other frameworks/compilers (e.g., Pytorch & ONNX), the final results would be inconsistent with other frameworks/compilers in complex scenarios (i.e., a model containing more ops).Code to repro
Error log
Environment & Version
ubuntu 20
TVM d1ac1c0
cc @KJlaccHoeUM9l @shingjan @yelite
The text was updated successfully, but these errors were encountered: