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

Jacobian returns one array #351

Merged
merged 4 commits into from
Jun 2, 2022
Merged

Jacobian returns one array #351

merged 4 commits into from
Jun 2, 2022

Conversation

vchuravy
Copy link
Member

@vchuravy vchuravy commented Jun 1, 2022

No description provided.

@vchuravy
Copy link
Member Author

vchuravy commented Jun 1, 2022

@YingboMa what's the most useful/common output of the jacobian function in the ecosystem?

@vchuravy vchuravy added this to the release-0.10 milestone Jun 1, 2022
@vchuravy vchuravy changed the base branch from main to vc/fwd_grad_extra_tuple June 1, 2022 21:22
@vchuravy vchuravy requested a review from wsmoses June 1, 2022 21:22
@vchuravy vchuravy changed the title WIP: Jacobian returns one array Jacobian returns one array Jun 1, 2022
@vchuravy vchuravy marked this pull request as ready for review June 1, 2022 21:25
@vchuravy
Copy link
Member Author

vchuravy commented Jun 1, 2022

Ok now we are in agreement with ForwardDiff.jl

Base automatically changed from vc/fwd_grad_extra_tuple to main June 1, 2022 22:55
@vchuravy vchuravy changed the base branch from main to vc/version June 1, 2022 23:09
Base automatically changed from vc/version to main June 2, 2022 00:05
@@ -780,6 +787,7 @@ end
adjoint(Duplicated(x, dx), tape)
return dx
end
mapreduce(LinearAlgebra.adjoint, vcat, rows)
Copy link
Member

Choose a reason for hiding this comment

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

Kind of hacky, but would it be possible to create the zero init'd matrix, then unsafe_array it at the corresponding offset for each index to avoid making a bunch of temporaries

Copy link
Member Author

Choose a reason for hiding this comment

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

I will leave that for you as an optimization.

test/runtests.jl Outdated Show resolved Hide resolved
@vchuravy vchuravy merged commit d48e1f3 into main Jun 2, 2022
@vchuravy vchuravy deleted the vc/jacobian branch June 2, 2022 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants