-autodiff(Forward, f, Duplicated(1.0, 1.0))</code></pre><p>Enzyme has to allocate a shadow object for <code>o</code> and in the process encounters the finalizer being attached to the primal object. Now the question is what should Enzyme do with the finalizer for the shadow objects? One option would be to simply ignore it, but finalizers are often used for resource management (like manually allocating memory) and thus we would leak resources that are attached to the shadow object. Instead, we define finalizers to be inactive (contain no instructions that are relevant with respect to AD), yet we must attach them to the shadow object to release resources attached to them. </p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../notebooks/ignore_derivatives/">« Ignore derivatives</a><a class="docs-footer-nextpage" href="../api/">API reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.15.0 on <span class="colophon-date" title="Monday 10 November 2025 23:07">Monday 10 November 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
0 commit comments