Skip to content

Commit

Permalink
Made tensorflow IsNan actually work (apache#7320)
Browse files Browse the repository at this point in the history
* Made tensorflow IsNan actually work

IsNan was added to tensorflow.rst in fa1b859 but this commit makes IsNan actually work

* Added test case for tensorflow.is_nan
  • Loading branch information
jchia authored and electriclilies committed Feb 18, 2021
1 parent 433e4b6 commit aaa87bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/tvm/relay/frontend/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2357,6 +2357,7 @@ def _impl(inputs, attr, params, mod):
"Identity": _identity(),
"IsFinite": AttrCvt("isfinite"),
"IsInf": AttrCvt("isinf"),
"IsNan": AttrCvt("isnan"),
"LeakyRelu": AttrCvt("leaky_relu"),
"LeftShift": AttrCvt("left_shift"),
"Less": _broadcast("less"),
Expand Down
4 changes: 4 additions & 0 deletions tests/python/frontend/tensorflow/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -4178,6 +4178,10 @@ def test_forward_isfinite():
_verify_infiniteness_ops(tf.is_finite, "isfinite")


def test_forward_isnan():
_verify_infiniteness_ops(tf.is_nan, "isnan")


def _test_spop_placeholder_without_shape_info():
with tf.Graph().as_default():

Expand Down

0 comments on commit aaa87bf

Please sign in to comment.