Skip to content
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

Minor gradcheck update to reduce computations #45757

Closed
wants to merge 2 commits into from

Conversation

anjali411
Copy link
Contributor

@anjali411 anjali411 commented Oct 2, 2020

Stack from ghstack:

Differential Revision: D24137143

anjali411 added a commit that referenced this pull request Oct 2, 2020
ghstack-source-id: 4d1727be980f3e6edb73c51b8ac909760bbd0cb1
Pull Request resolved: #45757
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

d[d_idx] = torch.real(dL_dz_conj)
# dL_dz_conj = 0.5 * [grad_out.conj() * ds_dx + grad_out * ds_dx.conj()]
# = 0.5 * [grad_out.conj() * ds_dx + (grad_out.conj() * ds_dx).conj()]
# = 0.5 * 2 * real(grad_out.conj() * ds_dx)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you want to go all the way, you can add an extra line with just the final formula that you implement below

anjali411 added a commit that referenced this pull request Oct 6, 2020
ghstack-source-id: 124780f16903c76158f77f0a1e45df60f196830c
Pull Request resolved: #45757
@facebook-github-bot
Copy link
Contributor

@anjali411 merged this pull request in a3662fa.

@facebook-github-bot facebook-github-bot deleted the gh/anjali411/63/head branch October 10, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants