|
65 | 65 | function Base.:(==)(a::Tangent{P,T}, b::Tangent{P,T}) where {P,T}
|
66 | 66 | return backing(a) == backing(b)
|
67 | 67 | end
|
68 |
| -function Base.:(==)(a::Tangent{P}, b::Tangent{P}) where {P,T} |
| 68 | +function Base.:(==)(a::Tangent{P}, b::Tangent{P}) where {P} |
69 | 69 | all_fields = union(keys(backing(a)), keys(backing(b)))
|
70 | 70 | return all(getproperty(a, f) == getproperty(b, f) for f in all_fields)
|
71 | 71 | end
|
@@ -117,7 +117,7 @@ function Base.getindex(tangent::Tangent{P,T}, idx::Symbol) where {P,T<:NamedTupl
|
117 | 117 | hasfield(T, idx) || return ZeroTangent()
|
118 | 118 | return unthunk(getfield(backing(tangent), idx))
|
119 | 119 | end
|
120 |
| -function Base.getindex(tangent::Tangent, idx) where {P,T<:AbstractDict} |
| 120 | +function Base.getindex(tangent::Tangent, idx) |
121 | 121 | return unthunk(getindex(backing(tangent), idx))
|
122 | 122 | end
|
123 | 123 |
|
@@ -237,8 +237,8 @@ canonicalize(tangent::Tangent{<:Any,<:AbstractDict}) = tangent
|
237 | 237 | # Tangents of unspecified primal types (indicated by specifying exactly `Any`)
|
238 | 238 | # all combinations of type-params are specified here to avoid ambiguities
|
239 | 239 | canonicalize(tangent::Tangent{Any,<:NamedTuple{L}}) where {L} = tangent
|
240 |
| -canonicalize(tangent::Tangent{Any,<:Tuple}) where {L} = tangent |
241 |
| -canonicalize(tangent::Tangent{Any,<:AbstractDict}) where {L} = tangent |
| 240 | +canonicalize(tangent::Tangent{Any,<:Tuple}) = tangent |
| 241 | +canonicalize(tangent::Tangent{Any,<:AbstractDict}) = tangent |
242 | 242 |
|
243 | 243 | """
|
244 | 244 | _zeroed_backing(P)
|
|
0 commit comments