Open parth-07 opened 2 years ago
@vgvassilev does this issue actually want any further support for the non-differentiable attribute? maybe I'm missing something, but I think this already works in forward mode and when #916 is merged will work in reverse mode too, so maybe I should make #916 close this too?
I think so. Do we have a test that explicitly tests this issue?
We have recently added class type support in Clad. Currently, all fields of the class are assumed to be differentiable. Practically, there are many non-differentiable fields in the class. We may not need to create derived statements for the expressions modifying non-differentiable fields, thus if we know which fields are non-differentiable, we can ideally produce more optimal derived function code.
One way to specify non-differentiable fields is by using C++ attributes: