You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "yelite (via GitHub)" <gi...@apache.org> on 2023/03/02 14:29:33 UTC

[GitHub] [tvm] yelite commented on a diff in pull request #14171: [Unity][Op] Full support of Relax op `power`

yelite commented on code in PR #14171:
URL: https://github.com/apache/tvm/pull/14171#discussion_r1123171256


##########
python/tvm/relax/frontend/torch/fx_translator.py:
##########
@@ -158,6 +158,12 @@ def _mul(self, node: fx.node.Node) -> relax.Expr:
             return self._call_binary_op(relax.op.multiply, lhs, rhs)
         return lhs * rhs
 
+    def _pow(self, node: fx.node.Node) -> relax.Expr:
+        lhs, rhs = self.retrieve_args(node)
+        if isinstance(lhs, relax.Var) or isinstance(rhs, relax.Var):
+            return self._call_binary_op(relax.op.power, lhs, rhs)
+        return lhs - rhs

Review Comment:
   Should it be `lhs ** rhs`?



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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org