mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-21 19:18:55 +00:00
### Description Remove unused and confusing special constants in MLFloat16 and BFloat16 types. ### Motivation and Context While looking at adding a specialization for std::numeric_limits for the 16-bit floating point types, I found that there are various special constants in those types that are confusing or just wrong. MLFLoat16::Epsilon is not an epsilon at all, but approximates "e". Looks like a copy-paste bug. BFloat16::Epsilon does not correspond to `numeric_limits::epsilon()`, nor even to the C# Float.Epsilon. Instead, it corresponds to `numeric_limits::min()` which was really confusing to me. The "MinValue" constants does correspond to the C# `Float.MinValue` constant, but this is C++ so it would be better renamed to "LowestValue" since it corresponds to `numeric_limits::lowest()`. As it was unused except for some unit tests I have replaced it with the equivalent `MaxValue.Negate()` here. There's also an unused `kSignaling_NaNBits` constant which is just wrong (has the same value as `kPositiveInfinityBits` instead of a NaN). |
||
|---|---|---|
| .. | ||
| cuda_ops.cu | ||
| custom_op_utils.cc | ||
| custom_op_utils.h | ||
| fns_candy_style_transfer.c | ||
| onnx_protobuf.h | ||
| rocm_ops.hip | ||
| test_allocator.cc | ||
| test_fixture.h | ||
| test_inference.cc | ||
| test_io_types.cc | ||
| test_model_loading.cc | ||
| test_nontensor_types.cc | ||
| test_ort_format_models.cc | ||
| test_run_options.cc | ||
| test_session_options.cc | ||
| utils.cc | ||
| utils.h | ||