You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: previews/PR378/backend/index.html
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -59,9 +59,9 @@
59
59
return g
60
60
end</code></pre><p>Finally, we use the homemade backend to compute the gradient.</p><pre><codeclass="language-julia hljs">nlp = ADNLPModel(sum, ones(3), gradient_backend = NewADGradient)
61
61
grad(nlp, nlp.meta.x0) # returns the gradient at x0 using `NewADGradient`</code></pre><preclass="documenter-example-output"><codeclass="nohighlight hljs ansi">3-element Vector{Float64}:
62
-
0.5638351156014024
63
-
0.0940747895976225
64
-
0.14943373915086322</code></pre><h3id="Change-backend"><aclass="docs-heading-anchor" href="#Change-backend">Change backend</a><aid="Change-backend-1"></a><aclass="docs-heading-anchor-permalink" href="#Change-backend" title="Permalink"></a></h3><p>Once an instance of an <code>ADNLPModel</code> has been created, it is possible to change the backends without re-instantiating the model.</p><pre><codeclass="language-julia hljs">using ADNLPModels, NLPModels
62
+
0.24363531026913166
63
+
0.17502618784272284
64
+
0.5414674266449258</code></pre><h3id="Change-backend"><aclass="docs-heading-anchor" href="#Change-backend">Change backend</a><aid="Change-backend-1"></a><aclass="docs-heading-anchor-permalink" href="#Change-backend" title="Permalink"></a></h3><p>Once an instance of an <code>ADNLPModel</code> has been created, it is possible to change the backends without re-instantiating the model.</p><pre><codeclass="language-julia hljs">using ADNLPModels, NLPModels
74.119629992927</code></pre><p>It is now possible to move to a different type, for instance <code>Float32</code>, while keeping the instance <code>nlp</code>.</p><pre><codeclass="language-julia hljs">x0_32 = ones(Float32, 2)
135
+
-75.32305744231081
136
+
126.41561939843298</code></pre><p>It is now possible to move to a different type, for instance <code>Float32</code>, while keeping the instance <code>nlp</code>.</p><pre><codeclass="language-julia hljs">x0_32 = ones(Float32, 2)
-43.087852478027344</code></pre></article><navclass="docs-footer"><aclass="docs-footer-prevpage" href="../tutorial/">« Tutorial</a><aclass="docs-footer-nextpage" href="../predefined/">Default backends »</a><divclass="flexbox-break"></div><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal" id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="auto">Automatic (OS)</option><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option><optionvalue="catppuccin-latte">catppuccin-latte</option><optionvalue="catppuccin-frappe">catppuccin-frappe</option><optionvalue="catppuccin-macchiato">catppuccin-macchiato</option><optionvalue="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.16.1 on <spanclass="colophon-date" title="Wednesday 18 February 2026 18:25">Wednesday 18 February 2026</span>. Using Julia version 1.10.10.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></html>
140
+
-14.64466381072998
141
+
64.16130065917969</code></pre></article><navclass="docs-footer"><aclass="docs-footer-prevpage" href="../tutorial/">« Tutorial</a><aclass="docs-footer-nextpage" href="../predefined/">Default backends »</a><divclass="flexbox-break"></div><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal" id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="auto">Automatic (OS)</option><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option><optionvalue="catppuccin-latte">catppuccin-latte</option><optionvalue="catppuccin-frappe">catppuccin-frappe</option><optionvalue="catppuccin-macchiato">catppuccin-macchiato</option><optionvalue="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.17.0 on <spanclass="colophon-date" title="Wednesday 25 February 2026 00:10">Wednesday 25 February 2026</span>. Using Julia version 1.10.10.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></html>
0 commit comments