-
Notifications
You must be signed in to change notification settings - Fork 41
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
Automatic Differentiation #82
Conversation
return _repartition(p, N₁) | ||
end | ||
|
||
TensorKit.block(t::ZeroTangent, c::Sector) = t |
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 seems a bit suspicious? Why is this needed?
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 is mostly to avoid having to manually deal with the ZeroTangent
type. For example, a QR decomposition where the final result does not depend on R, would generate a ZeroTangent
for dR, which is just an abstract representation that behaves as the zero vector in any (co)vectorspace. As some of the rrules
are implemented "blockwise", this would either require manually checking if a tangent is a ZeroTangent
, or, which is what I chose to do, rely on the hope that the compiler would recognize that the blockwise operation results in ZeroTangents anyways, and thus automatically takes care of this
tensorscalar now has a `rrule`
This PR adds rrules and tests for most linear algebra methods.
Note that the tests for
tsvd
are disabled when working withComplex
, as I have not been able to figure out how to make the lack of uniqueness ofU
andV
work with finite differences and or the ChainRulesTestUtils interface.