diff --git a/include/mitsuba/core/autodiff.h b/include/mitsuba/core/autodiff.h index 7cb6eec5..990bbebd 100644 --- a/include/mitsuba/core/autodiff.h +++ b/include/mitsuba/core/autodiff.h @@ -254,6 +254,12 @@ public: grad *= v; return *this; } + + inline DScalar1& operator*=(const DScalar1 &v) { + grad = v.grad * value + grad * v.value; + value *= v.value; + return *this; + } /// @} // ======================================================================