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/06/28 19:51:52 UTC

[GitHub] [tvm] masahi commented on a diff in pull request #11935: [PyTorch][Relay] Add aten::cross_entropy_loss

masahi commented on code in PR #11935:
URL: https://github.com/apache/tvm/pull/11935#discussion_r908883813


##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -867,6 +867,23 @@ def log_sigmoid(self, inputs, input_types):
         data = inputs[0]
         return _op.log(_op.tensor.sigmoid(data))
 
+    def cross_entropy_loss(self, inputs, input_types):
+        input = inputs[0]
+        target = inputs[1]
+        weight = inputs[2]
+        reduction = inputs[3]
+        ignore_index = inputs[4]
+        label_smoothing = inputs[5]
+        assert weight is None, "weight not supported in cross_entropy_loss"
+        assert reduction == 1, "reduction not supported in cross_entropy_loss"
+        assert ignore_index == -100, "reduce not supported in cross_entropy_loss"

Review Comment:
   typo



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