MarisaKirisame commented on a change in pull request #6767:
URL: https://github.com/apache/incubator-tvm/pull/6767#discussion_r513029211
##########
File path: python/tvm/relay/op/_tensor_grad.py
##########
@@ -665,3 +673,115 @@ def cross_entropy_with_logits_grad(orig, grad):
batch_size = take(shape, const(0, dtype="int32"), axis=0)
grad = grad / batch_size.astype(x.checked_type.dtype)
return [-grad * y, -grad * x]
+
+
+@register_gradient("take")
+def take_grad(orig, grad):
Review comment:
Both are fine.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]