tqchen commented on code in PR #17707:
URL: https://github.com/apache/tvm/pull/17707#discussion_r1983382704


##########
python/tvm/relax/frontend/torch/base_fx_graph_translator.py:
##########
@@ -921,6 +936,16 @@ def _stack(self, node: fx.Node) -> relax.Var:
                 s_shape.append(s)
         return self.block_builder.emit(relax.op.reshape(cat, s_shape))
 
+    def _take(self, node: fx.Node, axis: Optional[int] = None) -> relax.Var:
+        x = self.env[node.args[0]]
+        indices = self.env[node.args[1]]
+        indices = self.block_builder.emit(relax.op.astype(indices, "int32"))
+        if axis is not None:
+            raise NotImplementedError(
+                "Relax's relax.op.take() does not fully support PyTorch's 
torch.take()."

Review Comment:
   would be great to think about a path toward supporting the full behavior



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