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

Support mutating functions f!(y, x) #41

Merged
merged 3 commits into from
Mar 14, 2024
Merged

Support mutating functions f!(y, x) #41

merged 3 commits into from
Mar 14, 2024

Conversation

gdalle
Copy link
Member

@gdalle gdalle commented Mar 14, 2024

Core

  • Define fallback structure for mutating functions f!(y, x)
  • Add appropriate signatures to docstrings for value_and_pushforward!, value_and_pullback!, value_and_multiderivative!, value_and_jacobian!
  • Add possible argument y to preparation functions
  • Link most docstrings to function name instead of method

Extensions

  • Put everyone into their own folder
  • Fully support mutation with ForwardDiff
  • Strengthen typing to resolve method ambiguities spotted by Aqua (whenever possible, type the storage but don't type the seed in case it's a Tangent / Thunk)

Docs

  • Update README.md with the two kinds of functions: allocating and mutating
  • Update docs/src/getting_started.md with an explanation of mutating functions
  • Update docs/src/backends.md with the compatibility for mutating functions
  • Update docs/src/developer.md with the fallback structure for mutating functions

Tests

  • Add utilities to construct mutating Scenarios
  • Insert mutating Scenarios into the default suite
  • Toggle type stability wherever possible (jacobians are still unstable in a lot of places)

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 88.55219% with 34 lines in your changes are missing coverage. Please review.

Project coverage is 91.14%. Comparing base (ccb7f43) to head (75eca1e).

Files Patch % Lines
...t/DifferentiationInterfaceTestExt/test_mutating.jl 69.72% 33 Missing ⚠️
...dDiffExt/DifferentiationInterfaceForwardDiffExt.jl 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   92.60%   91.14%   -1.46%     
==========================================
  Files          26       29       +3     
  Lines         649      881     +232     
==========================================
+ Hits          601      803     +202     
- Misses         48       78      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle gdalle merged commit be4f4a8 into main Mar 14, 2024
3 checks passed
@gdalle gdalle deleted the gd/mutating branch March 17, 2024 13:40
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