From 2132e80cb2ff7bf0807701753cac0e1268625809 Mon Sep 17 00:00:00 2001 From: Joshua Chia Date: Thu, 21 Jan 2021 17:49:14 +0800 Subject: [PATCH 1/2] Made tensorflow IsNan actually work IsNan was added to tensorflow.rst in fa1b859f but this commit makes IsNan actually work --- python/tvm/relay/frontend/tensorflow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/tvm/relay/frontend/tensorflow.py b/python/tvm/relay/frontend/tensorflow.py index d5746a38582c..2c7361a7d813 100644 --- a/python/tvm/relay/frontend/tensorflow.py +++ b/python/tvm/relay/frontend/tensorflow.py @@ -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"), From 09d33c481a685b214e6dbebae56c8b1f5715856c Mon Sep 17 00:00:00 2001 From: Joshua Chia Date: Thu, 21 Jan 2021 22:31:39 +0800 Subject: [PATCH 2/2] Added test case for tensorflow.is_nan --- tests/python/frontend/tensorflow/test_forward.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/python/frontend/tensorflow/test_forward.py b/tests/python/frontend/tensorflow/test_forward.py index d71405796ede..3c30b6662c81 100644 --- a/tests/python/frontend/tensorflow/test_forward.py +++ b/tests/python/frontend/tensorflow/test_forward.py @@ -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():