Onnxruntime: when there are few cast connected, the result might be wrong

Created on 2 Feb 2019  路  3Comments  路  Source: microsoft/onnxruntime

Describe the bug

look at the graph below. The input is bool[1, 100], we for example feed it with all True.

Then Cast (to 1) change it to all 1.0.

Then ReduceSum(axes=1) generate results [100.0]

Then Cast(to 9) change it to [True]

Then Cast(to 1) change it to [100.0]

So the last step should not expected, because user would expect: when they want to cast a True to float, the value should be 1.0.

I guess this is caused when Cast is computed, the value is not changed actually, maybe just a cast.

image

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
  • ONNX Runtime installed from (source or binary): master
  • ONNX Runtime version: master
  • Python version: 3.6
  • GCC/Compiler version (if compiling from source): VS 2017
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

To Reproduce
Describe steps/code to reproduce the behavior: see above

Expected behavior

whenever cast a bool True to float, the value should be 1.0

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

bug

All 3 comments

@raymondxyang could you fix this issue with your cast update?

Just verified the eigen (used in cast op kernel) will not produce the described result, when casting float->bool->float. in other word, 100.0 will be cast into 1.0 in this case. Could u send me the model for more debugging processes? @pengwa Thanks! 馃槂

followed up offline. can re-produce the error. looking into it..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pranav-prakash picture pranav-prakash  路  4Comments

lei-Qiao picture lei-Qiao  路  3Comments

JammyZhou picture JammyZhou  路  3Comments

fdwr picture fdwr  路  5Comments

shixinlishixinli picture shixinlishixinli  路  6Comments