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

Add function setladj #22

Merged
merged 2 commits into from
Jul 3, 2023
Merged

Add function setladj #22

merged 2 commits into from
Jul 3, 2023

Conversation

oschulz
Copy link
Collaborator

@oschulz oschulz commented Jul 3, 2023

@devmotion, this PR mirrors InverseFunctions.setinverse.

With this, we can do stuff like

computation_on_gpu  setladj(setinverse(CuArray, Array), Returns(0))  computation_on_cpu

I have several used cases that would profit from such "on-the-fly" adding of LADJ-computation (intermediate steps in transforming flows, etc). It's also very handy for demos and tutorials.

This PR also adds with_logabsdet_jacobian support for InverseFunctions.FunctionWithInverse.

CC @cscherrer

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (bdcf78c) 100.00% compared to head (5c58988) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #22   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         5    +2     
  Lines           61        82   +21     
=========================================
+ Hits            61        82   +21     
Impacted Files Coverage Δ
src/ChangesOfVariables.jl 100.00% <ø> (ø)
ext/ChangesOfVariablesInverseFunctionsExt.jl 100.00% <100.00%> (ø)
src/setladj.jl 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor comments.

src/setladj.jl Outdated Show resolved Hide resolved
src/setladj.jl Outdated Show resolved Hide resolved
src/setladj.jl Outdated Show resolved Hide resolved
src/setladj.jl Outdated Show resolved Hide resolved
@oschulz
Copy link
Collaborator Author

oschulz commented Jul 3, 2023

Thanks for the doc fixes @devmotion !

src/setladj.jl Show resolved Hide resolved
src/setladj.jl Show resolved Hide resolved
@oschulz
Copy link
Collaborator Author

oschulz commented Jul 3, 2023

I think we're good now.

@oschulz oschulz merged commit 5c58988 into master Jul 3, 2023
@oschulz oschulz deleted the setladj branch December 24, 2023 21:20
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.

3 participants