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 2022/09/01 11:45:31 UTC

[GitHub] [tvm] juda commented on a diff in pull request #12485: [Relay][Op] embedding_bag operator implementation

juda commented on code in PR #12485:
URL: https://github.com/apache/tvm/pull/12485#discussion_r960550601


##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -2247,6 +2247,47 @@ def embedding(self, inputs, input_types):
 
         return _op.take(weight, indices.astype("int32"), axis=0)
 
+    def embedding_bag(self, inputs, _):
+        assert len(inputs) == 9, "embedding_bag needs 9 arguments"
+        (
+            weights,
+            indices,
+            offsets_1d,
+            scale_grad_by_freq,
+            mode,
+            sparse,
+            per_sample_weights,
+            include_last_offset,
+            padding_idx,
+        ) = inputs
+
+        assert len(_infer_shape(indices)) == 1, "Expects 1D indices for aten::embedding_bag."
+
+        assert (

Review Comment:
   is it ok for current change?



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