mitsuba-renderer / drjit

Dr.Jit — A Just-In-Time-Compiler for Differentiable Rendering
BSD 3-Clause "New" or "Revised" License
601 stars 45 forks source link

Fix nested uses of `dr.wrap` with torch #273

Closed njroussel closed 2 months ago

njroussel commented 2 months ago

Fixes #270

Torch's autograd tracing is disabled inside of custom Function objects. This is an issue when there is a chain of nested dr.wrap function calls, as the inner functions will not track their gradients correctly. This commit forcefully enables gradient tracking just for the function call.