Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor ChainRulesCoreExt into separate files #133
Refactor ChainRulesCoreExt into separate files #133
Changes from 1 commit
fcad6a9
8a821e0
1148fe9
c15b7ab
76078de
7ada03f
e0ce389
c98624f
d06cca1
1827d6a
5003daa
655d9e0
99f71c0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
How about
dual = typeof(out)(:data => c[:data])
?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 don't think that works, because then the spaces are missing in the dictionary-to-tensormap converter. Maybe the comment is a bit misleading -- all fields in the dictionary are required, but Zygote tends to drop fields that do not contribute (i.e. codomain and domain). Thus, this uses the dictionary from the forwards pass with the data from the backwards pass.
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.
Ok. I wanted to avoid copying the
data
fromout
, but probablycopy(out)
is a shallow copy that does not duplicateout[:data]
?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.
Indeed, it should really only duplicate the pointer, which I think is acceptable. On top of that, I am not sure this rule is ever used/useful anyways. I think I copied this at some point from maarten, but presumably that was also only introduced for testing purposes, as it also suffers from the weird interplay of "inner product on the parameters" for non-abelian symmetries.
Check warning on line 38 in ext/TensorKitChainRulesCoreExt/constructors.jl
Codecov / codecov/patch
ext/TensorKitChainRulesCoreExt/constructors.jl#L32-L38
Check warning on line 41 in ext/TensorKitChainRulesCoreExt/constructors.jl
Codecov / codecov/patch
ext/TensorKitChainRulesCoreExt/constructors.jl#L41
Check warning on line 44 in ext/TensorKitChainRulesCoreExt/constructors.jl
Codecov / codecov/patch
ext/TensorKitChainRulesCoreExt/constructors.jl#L44
Check warning on line 46 in ext/TensorKitChainRulesCoreExt/constructors.jl
Codecov / codecov/patch
ext/TensorKitChainRulesCoreExt/constructors.jl#L46
Check warning on line 48 in ext/TensorKitChainRulesCoreExt/constructors.jl
Codecov / codecov/patch
ext/TensorKitChainRulesCoreExt/constructors.jl#L48