The current definition places no restrictions on the backing type T
|
struct Tangent{P,T} <: AbstractTangent |
|
# Note: If T is a Tuple/Dict, then P is also a Tuple/Dict |
|
# (but potentially a different one, as it doesn't contain differentials) |
|
backing::T |
|
end |
which means it can be something unexpected like an array, which caused relatively hard-to-diagnose issues here:
FluxML/Zygote.jl#1107 (comment)
Do we want to restrict T to be a NamedTuple/Tuple/Dict?
The current definition places no restrictions on the backing type
TChainRulesCore.jl/src/tangent_types/tangent.jl
Lines 24 to 28 in bde3166
which means it can be something unexpected like an array, which caused relatively hard-to-diagnose issues here:
FluxML/Zygote.jl#1107 (comment)
Do we want to restrict
Tto be aNamedTuple/Tuple/Dict?