Remove convert for structured Tangent? #359
Labels
breaking
a breaking change
Structural Tangent
Related to the `Tangent` type for structured (composite) values
Milestone
convert{::Type{B}, d::Tangent{P, B}} where {P, B} = backing(d)
is current provided.I don't think it is very useful as is. Using
backing
directly is more clear and is general in the way we mostly want.Alternatively we might want
convert{::Type{A}, d::Tangent} where A = convert(A, backing(d))
to actually do a convert based on the backing.
Which could be useful for pushing into vectors etc which might come up dealing with Zygotes's use of NamedTuples.
But the fact that we don't seem to use that suggest it isn't needed.
Zygote does right now use the current
convert
after first doing other steps to convert the content in different ways.This could just as well be done with
backing
if we exported that.https://github.com/FluxML/Zygote.jl/blob/7c66eff0a9200b1095f1c94ac6faec9f16b740fe/src/compiler/chainrules.jl#L52
If we got rid of the
convert
it would remove all the invalidations from the package.I am not sure how significant these ones are.
The text was updated successfully, but these errors were encountered: