-
Notifications
You must be signed in to change notification settings - Fork 63
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
add backward of conv2d #365
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you for your contribution. Could you provide performance data for our comparative analysis?
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.
there is error in benchmark. please solve it.
if stride_height > 1 or stride_width > 1: | ||
for i in range(out_grad.shape[2]): | ||
for j in range(out_grad.shape[3]): | ||
new_out[:, :, i * (stride_height), j * (stride_width)] = out_grad[ |
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 assignment will cost a lot of time. is there a better way?
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.
maybe you can reference to the implementation in flip and use a copy_func to fill the elements in new_out.
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.
done
tests/test_reduction_ops.py
Outdated
|
||
gems_assert_close(res_in_grad, ref_in_grad.to(dtype), dtype) | ||
gems_assert_close( | ||
res_in_grad.to(dtype), ref_in_grad.to(dtype), dtype, reduce_dim=weight.shape[2] |
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.
casting is useless here. gems_assert_close will do type casting for reference tensors.
add backwards of input weight bias for conv.