-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Relay] Add gradient for reshape #3901
Conversation
51d704d
to
c3596f7
Compare
@@ -247,6 +247,7 @@ def verify_reshape(shape, newshape, oshape): | |||
assert zz.checked_type == relay.ty.TensorType(oshape, "float32") | |||
|
|||
func = relay.Function([x], z) | |||
check_grad(func) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be a good idea to separate this test out since gradient is implemented separately from the op
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allow us to get the same coverage for both test_op_level3 and test_op_grad_level3. I think we should move toward this style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I think grad implementations could also use some refactoring to move around; it would be more convenient implementation-wise to put grad implementations next to their forward op implementations as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That also sounds good. Tensor_grad is getting big.
Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers.
@SWu @vinx13 @Ruinhuang can you guys help review?