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
Having two uses for the same type, only distinguishable by the context, is not good design. It was laziness on my part when I introduced fdata / rdata.
A better design would be to have two distinct types: PrimalFDataPair and PrimalTangentPair. These will be abbreviated to PFPair and PTPair respectively (otheriwse the code is going to become a lot more verbose).
Introducing this distinction will also substantially reduce the chances of bugs in interface code (value_and_gradient!!, DifferentiationInterface.jl's wrappers, etc) -- currently it's very straightforward to accidentally make a CoDual containing a primal + tangent, when you ought to have produce a CoDual containing a primal + fdata.
There are a couple of functions which will need to change -- for example zero_fcodual and zero_codual will become zero_primal_fdata_pair and zero_primal_tangent_pair. More verbose names are acceptable for these, as they do not appear in literally every rrule!! signature. There are probably some more that will appear during refactoring.
The text was updated successfully, but these errors were encountered:
Currently
CoDual
is used for two purposes:Having two uses for the same type, only distinguishable by the context, is not good design. It was laziness on my part when I introduced fdata / rdata.
A better design would be to have two distinct types:
PrimalFDataPair
andPrimalTangentPair
. These will be abbreviated toPFPair
andPTPair
respectively (otheriwse the code is going to become a lot more verbose).Introducing this distinction will also substantially reduce the chances of bugs in interface code (value_and_gradient!!, DifferentiationInterface.jl's wrappers, etc) -- currently it's very straightforward to accidentally make a
CoDual
containing a primal + tangent, when you ought to have produce aCoDual
containing a primal + fdata.There are a couple of functions which will need to change -- for example
zero_fcodual
andzero_codual
will becomezero_primal_fdata_pair
andzero_primal_tangent_pair
. More verbose names are acceptable for these, as they do not appear in literally everyrrule!!
signature. There are probably some more that will appear during refactoring.The text was updated successfully, but these errors were encountered: