You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/01/06 17:15:00 UTC

[GitHub] [incubator-tvm] anijain2305 commented on a change in pull request #4634: [Relay][Frontend][TFlite] Add parses support for unary elemwise ops

anijain2305 commented on a change in pull request #4634: [Relay][Frontend][TFlite] Add parses support for unary elemwise ops
URL: https://github.com/apache/incubator-tvm/pull/4634#discussion_r363391296
 
 

 ##########
 File path: tests/python/frontend/tflite/test_forward.py
 ##########
 @@ -616,6 +616,109 @@ def test_forward_concatenation():
          np.arange(6).reshape((2, 1, 1, 3)),
          np.arange(6).reshape((2, 1, 1, 3))], 1)
 
+#######################################################################
+# Unary elemwise
+# --------------
+
+def _test_unary_elemwise(math_op, data):
+    """ One iteration of unary elemwise """
+
+    with tf.Graph().as_default():
+        in_data = array_ops.placeholder(shape=data.shape, dtype=data.dtype, name='in')
+        out = math_op(in_data)
+        compare_tflite_with_tvm(data, ['in:0'], in_data, [out])
+
+#######################################################################
+# Abs
+# ---
+
+def _test_abs(data):
+    """ One iteration of abs """
+    return _test_unary_elemwise(math_ops.abs, data)
+#######################################################################
+# Ceil
+# ----
+
+def _test_ceil(data):
+    """ One iteration of ceil """
+    return _test_unary_elemwise(math_ops.ceil, data)
+#######################################################################
+# Floor
+# -----
+
+def _test_floor(data):
+    """ One iteration of floor """
+    return _test_unary_elemwise(math_ops.floor, data)
+#######################################################################
+# Exp
+# -----
 
 Review comment:
   2 extra "--".

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services