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/11/03 13:41:38 UTC

[GitHub] [incubator-tvm] alter-xp opened a new pull request #6818: TF frontend: add rint op

alter-xp opened a new pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818


   In order to enrich the support of TF operator and the need of practical work, we add rint op in tensorflow frontend.
   
   @giuseros
   


----------------------------------------------------------------
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



[GitHub] [incubator-tvm] siju-samuel commented on a change in pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on a change in pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#discussion_r517806176



##########
File path: tests/python/frontend/tensorflow/test_forward.py
##########
@@ -3520,6 +3520,23 @@ def _test_forward_softsign(shape):
     _test_forward_softsign([2, 5, 2, 5])
 
 
+def test_forward_rint():
+    """test operator rint """
+
+    def _test_forward_rint(shape):
+        tf.disable_eager_execution()
+        np_data = np.random.uniform(1, 100, size=shape).astype(np.float32)

Review comment:
       use 
   `np_data = np.random.uniform(-100, 100, size=shape).astype(np.float32)`
   




----------------------------------------------------------------
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



[GitHub] [incubator-tvm] alter-xp commented on a change in pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
alter-xp commented on a change in pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#discussion_r517054312



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -2391,6 +2391,7 @@ def _impl(inputs, attr, params, mod):
     "ReverseV2": _reverse_v2(),
     "RightShift": AttrCvt("right_shift"),
     "Round": AttrCvt("round"),
+    "Rint": AttrCvt("round"),

Review comment:
       🆗




----------------------------------------------------------------
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



[GitHub] [incubator-tvm] alter-xp commented on a change in pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
alter-xp commented on a change in pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#discussion_r517054236



##########
File path: tests/python/frontend/tensorflow/test_forward.py
##########
@@ -3520,6 +3520,23 @@ def _test_forward_softsign(shape):
     _test_forward_softsign([2, 5, 2, 5])
 
 
+def test_forward_rint():
+    """test operator rint """
+
+    def _test_forward_rint(shape):
+        tf.disable_eager_execution()
+        np_data = np.random.uniform(1, 100, size=shape).astype(np.float32)

Review comment:
       Thank you for your comments, but I don't get your point.
   What does '- ve floats' mean?




----------------------------------------------------------------
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



[GitHub] [incubator-tvm] siju-samuel commented on pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#issuecomment-724076853


   Thanks @alter-xp @giuseros . This PR is merged.


----------------------------------------------------------------
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



[GitHub] [incubator-tvm] alter-xp commented on a change in pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
alter-xp commented on a change in pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#discussion_r518041636



##########
File path: tests/python/frontend/tensorflow/test_forward.py
##########
@@ -3520,6 +3520,23 @@ def _test_forward_softsign(shape):
     _test_forward_softsign([2, 5, 2, 5])
 
 
+def test_forward_rint():
+    """test operator rint """
+
+    def _test_forward_rint(shape):
+        tf.disable_eager_execution()
+        np_data = np.random.uniform(1, 100, size=shape).astype(np.float32)

Review comment:
       thinks!




----------------------------------------------------------------
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



[GitHub] [incubator-tvm] alter-xp commented on a change in pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
alter-xp commented on a change in pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#discussion_r518041993



##########
File path: tests/python/frontend/tensorflow/test_forward.py
##########
@@ -3520,6 +3520,23 @@ def _test_forward_softsign(shape):
     _test_forward_softsign([2, 5, 2, 5])
 
 
+def test_forward_rint():
+    """test operator rint """
+
+    def _test_forward_rint(shape):
+        tf.disable_eager_execution()
+        np_data = np.random.uniform(1, 100, size=shape).astype(np.float32)

Review comment:
       thanks!




----------------------------------------------------------------
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



[GitHub] [incubator-tvm] giuseros commented on pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
giuseros commented on pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#issuecomment-721392771


   Hi @alter-xp ,
   Given you address @siju-samuel comments, this LGTM


----------------------------------------------------------------
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



[GitHub] [incubator-tvm] alter-xp commented on a change in pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
alter-xp commented on a change in pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#discussion_r518041636



##########
File path: tests/python/frontend/tensorflow/test_forward.py
##########
@@ -3520,6 +3520,23 @@ def _test_forward_softsign(shape):
     _test_forward_softsign([2, 5, 2, 5])
 
 
+def test_forward_rint():
+    """test operator rint """
+
+    def _test_forward_rint(shape):
+        tf.disable_eager_execution()
+        np_data = np.random.uniform(1, 100, size=shape).astype(np.float32)

Review comment:
       thanks!




----------------------------------------------------------------
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



[GitHub] [incubator-tvm] siju-samuel commented on a change in pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on a change in pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818#discussion_r516413347



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -2391,6 +2391,7 @@ def _impl(inputs, attr, params, mod):
     "ReverseV2": _reverse_v2(),
     "RightShift": AttrCvt("right_shift"),
     "Round": AttrCvt("round"),
+    "Rint": AttrCvt("round"),

Review comment:
       preserve the alphabetical order. keep Rint above Round.

##########
File path: tests/python/frontend/tensorflow/test_forward.py
##########
@@ -3520,6 +3520,23 @@ def _test_forward_softsign(shape):
     _test_forward_softsign([2, 5, 2, 5])
 
 
+def test_forward_rint():
+    """test operator rint """
+
+    def _test_forward_rint(shape):
+        tf.disable_eager_execution()
+        np_data = np.random.uniform(1, 100, size=shape).astype(np.float32)

Review comment:
       include -ve floats also for testing.




----------------------------------------------------------------
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



[GitHub] [incubator-tvm] siju-samuel merged pull request #6818: TF frontend: add rint op

Posted by GitBox <gi...@apache.org>.
siju-samuel merged pull request #6818:
URL: https://github.com/apache/incubator-tvm/pull/6818


   


----------------------------------------------------------------
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