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


##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -2242,6 +2243,29 @@ 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,

Review Comment:
   Per offline discussion, we think that we can leave `scale_grad_by_freq` and 
`sparse`. It would be great if we can ignore those arguments here in the python 
end, which makes the logic more clear.



##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -2242,6 +2243,29 @@ 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,

Review Comment:
   Per offline discussion, we think that we can leave `scale_grad_by_freq` and 
`sparse` unused. It would be great if we can ignore those arguments here in the 
python end, which makes the logic more clear.



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