Skip to content

Remove Composite Bundle #216

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

Merged
merged 15 commits into from
Sep 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/tangent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,13 @@ end
const TaylorBundle{N, B, P} = TangentBundle{N, B, TaylorTangent{P}}

function TaylorBundle{N, B}(primal::B, coeffs) where {N, B}
# check_taylor_invariants(coeffs, primal, N) # TODO: renable this
check_taylor_invariants(coeffs, primal, N)
_TangentBundle(Val{N}(), primal, TaylorTangent(coeffs))
end

function check_taylor_invariants(coeffs, primal, N)
@assert length(coeffs) == N
if isa(primal, TangentBundle)
@assert isa(coeffs[1], TangentBundle)
Copy link
Member Author

Choose a reason for hiding this comment

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

this check is just wrong AFAICT.
because if the primal is a TangentBundle, then the first derivative is a Tangent{TangentBundle}
The first deriviative has no primal component.

But this was never hit before because we were not making TaylorBundles when taking derivatives of TaylorBundles, (at least not in anything that happens in our test/forward.jl I checked) we were (I assume) making CompositeBundles

end

end
@ChainRulesCore.non_differentiable check_taylor_invariants(coeffs, primal, N)

Expand Down