onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

[Training] Fix Overflow Handling in Cast Infer for ORTModule.

Open AdamLouly opened this issue 1 year ago • 0 comments

Description

Infer cast function in symbolic shape infer cannot handle inf values and returns this error:

  File "/usr/local/lib/python3.10/dist-packages/onnxruntime/tools/symbolic_shape_infer.py", line 607, in int_or_float
    return int(value)
OverflowError: cannot convert float infinity to integer

added a fix to handle NaN and inf values.

AdamLouly avatar Jun 28 '24 07:06 AdamLouly