masahi commented on a change in pull request #9893:
URL: https://github.com/apache/tvm/pull/9893#discussion_r781511298



##########
File path: python/tvm/relay/op/tensor.py
##########
@@ -1136,6 +1136,25 @@ def einsum(data, equation):
     return _make.einsum(Tuple(data), equation)
 
 
+def dot(lhs, rhs):
+    """Compute the dot product of two 1D tensors
+
+    Parameters
+    ----------
+    lhs : relay.Expr input tensor
+    rhs : relay.Expr input tensor
+
+    Returns
+    -------
+    result : relay.Expr
+        The output tensor from the dot op.
+    """
+    mul_result = _make.multiply(lhs, rhs)
+    axis = None
+    keepdims = False
+    exclude = False
+    return _make.sum(mul_result, axis, keepdims, exclude)

Review comment:
       LGTM but please move your conversion to `pytorch.py` or 
`frontend/common.py`
   
   You add a new op here when you introduce a full-brown relay op (which 
involves a lot of boilerplate).




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to