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/10/28 06:19:59 UTC

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

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


   Thanks for contributing to TVM!   Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @ them in the pull request thread.
   


----------------------------------------------------------------
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 #6783: TF frontend: add expm1 op

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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _expm1():
+    def _impl(inputs, attr, params, mod):
+        lh = get_relay_op("exp")(inputs[0])
+        return get_relay_op("subtract")(lh, tvm.relay.const(1, attr["T"].name))

Review comment:
       The operator` - `can be used, but cannot be written as` lh - 1`. I replaced `subtract` with `exp_out-1.`




----------------------------------------------------------------
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 a change in pull request #6783: TF frontend: add expm1 op

Posted by GitBox <gi...@apache.org>.
giuseros commented on a change in pull request #6783:
URL: https://github.com/apache/incubator-tvm/pull/6783#discussion_r513384321



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _expm1():

Review comment:
       Could you add the docstring  describing what this operation is doing? 

##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _expm1():
+    def _impl(inputs, attr, params, mod):
+        lh = get_relay_op("exp")(inputs[0])
+        return get_relay_op("subtract")(lh, tvm.relay.const(1, attr["T"].name))

Review comment:
       Not entirely sure, but can't you write `return lh -1`? Isn't there an overload for the `-` operator?




----------------------------------------------------------------
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 #6783: TF frontend: add expm1 op

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


   LGTM, thanks for addressing my comments!


----------------------------------------------------------------
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 #6783: TF frontend: add expm1 op

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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _expm1():

Review comment:
       Okay, I added TF description address




----------------------------------------------------------------
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 #6783: TF frontend: add expm1 op

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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _expm1():
+    def _impl(inputs, attr, params, mod):
+        lh = get_relay_op("exp")(inputs[0])
+        return get_relay_op("subtract")(lh, tvm.relay.const(1, attr["T"].name))

Review comment:
       The operator` - `can be used, but cannot be written as` lh - 1`. I replaced `subtract` with `exp_out - tvm.relay.const(1.0)`.




----------------------------------------------------------------
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 #6783: TF frontend: add expm1 op

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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _expm1():
+    def _impl(inputs, attr, params, mod):
+        lh = get_relay_op("exp")(inputs[0])
+        return get_relay_op("subtract")(lh, tvm.relay.const(1, attr["T"].name))

Review comment:
       The operator` - `can be used, but cannot be written as` lh - 1`. I replaced 'subtract' with `exp_out-1.`




----------------------------------------------------------------
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] kevinthesun merged pull request #6783: TF frontend: add expm1 op

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


   


----------------------------------------------------------------
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] kevinthesun commented on pull request #6783: TF frontend: add expm1 op

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


   Thanks @alter-xp @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] alter-xp commented on a change in pull request #6783: TF frontend: add expm1 op

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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _expm1():
+    def _impl(inputs, attr, params, mod):
+        lh = get_relay_op("exp")(inputs[0])
+        return get_relay_op("subtract")(lh, tvm.relay.const(1, attr["T"].name))

Review comment:
       The operator` - `can be used, but cannot be written as` lh - 1`. I replaced "subtract" with `exp_out-1.`




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