-
-
Notifications
You must be signed in to change notification settings - Fork 118
Closed
Labels
Description
Checklist
- I have searched the existing issues and discussions for a similar question or problem.
- I have read the documentation and tried to find an answer there.
- I am using the latest version of Optiland (if not, please update and retry).
- I have tried to reproduce or debug the issue myself before opening this.
- I have included all necessary context, such as version info, error messages, or minimal reproducible examples.
Thanks for taking the time to go through this — it really helps us help you!
Bug Report
Describe the bug
Material n / k caching causes RuntimeError under torch + grad mode
When using the torch backend with gradient tracking enabled, calling .backward() more than once during optimization raises the RuntimeError saying "Trying to backward through the graph a second time...".
To Reproduce
Run the torch optimization notebooks with the most recent optiland version, and you will get the RuntimeError
Expected behavior
Optimization should proceed.
Environment
- Optiland Version: latest version
Reactions are currently unavailable