DifferentiationInterface.jl icon indicating copy to clipboard operation
DifferentiationInterface.jl copied to clipboard

Use Zygote Buffer for mutating functions

Open gdalle opened this issue 1 year ago • 3 comments

DI extensions

  • Use Zygote.Buffer to allow writing into the output y when differentiating through f!(y, x) with Zygote. Note that other mutations inside the function (e.g. of temporary storage) will still error.

gdalle avatar Jul 16 '24 07:07 gdalle

Codecov Report

Attention: Patch coverage is 52.08333% with 46 lines in your changes missing coverage. Please review.

Project coverage is 93.11%. Comparing base (d0e26ef) to head (b2a755c).

Files Patch % Lines
...ce/ext/DifferentiationInterfaceZygoteExt/onearg.jl 51.47% 33 Missing :warning:
...ce/ext/DifferentiationInterfaceZygoteExt/twoarg.jl 0.00% 11 Missing :warning:
...faceZygoteExt/DifferentiationInterfaceZygoteExt.jl 0.00% 1 Missing :warning:
...ZygoteExt/DifferentiationInterfaceTestZygoteExt.jl 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #360      +/-   ##
==========================================
- Coverage   96.68%   93.11%   -3.58%     
==========================================
  Files         103      104       +1     
  Lines        4981     4968      -13     
==========================================
- Hits         4816     4626     -190     
- Misses        165      342     +177     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 16 '24 07:07 codecov-commenter

@Vaibhavdixit02 I can't figure out why this fails and it is very low-priority for me. If you wanna get your hands dirty, feel free, but otherwise I don't know if the issue is really worth pressing?

gdalle avatar Aug 05 '24 07:08 gdalle

I have figured out a way to do it at my end so I don't need this as much anymore, I'll give this a shot but if you couldn't get it to work I don't believe that I'll be able to in your codebase haha

Vaibhavdixit02 avatar Aug 05 '24 12:08 Vaibhavdixit02