Add IsInf to detect infinity values#1884
Conversation
| #### Attributes | ||
|
|
||
| <dl> | ||
| <dt><tt>detectnegativeinfinity</tt> : int (default is 0)</dt> |
There was a problem hiding this comment.
Use the same style for attribute naming as the rest of ONNX. The above should be 'detect_negative_infinity'.
There was a problem hiding this comment.
Test files are added and now the strategy becomes
- Not to touch IsNaN
- Add IsInf instead.
|
|
||
| <dl> | ||
| <dt><tt>detectnegativeinfinity</tt> : int (default is 0)</dt> | ||
| <dd>(Optional) Whether map negative infinity to true. Default to 1 so that negative infinity induces true. Set this attribute to 0 if positive infinity should be mapped to false.</dd> |
There was a problem hiding this comment.
"positive" => "negative"
| "detectnegativeinfinity", | ||
| "(Optional) Whether map negative infinity to true. Default to 1 " | ||
| "so that negative infinity induces true. Set this attribute to 0 " | ||
| "if positive infinity should be mapped to false.", |
There was a problem hiding this comment.
"positive" => "negative"
|
Adding a test-case to test this would be helpful. |
|
@wschin - This is useful functionality and will be a welcome addition to ONNX. But have we considered an alternate design where we have a separate op for detecting
|
|
@spandantiwari, sounds good. I will update this PR to add |
|
@wschin - OK, that sounds good. Thanks for your consideration. |
LGTM. |
* Add IsInf * Add test files * Fix attribute names * Format code * Update doc * Add coverage change
* Add IsInf * Add test files * Fix attribute names * Format code * Update doc * Add coverage change
In addition to
NaN, positive and negative values are also very important special values in floating-number system, so it'd be nice ifIsInfcan support them.