@@ -5,6 +5,7 @@ Representing the type of the tangent of a `struct` `P` (or a `Tuple`/`NamedTuple
5
5
as an object with mirroring fields.
6
6
7
7
!!!!!! warning Exprimental
8
+ `StructuralTangent` is an experimental feature, and is part of the mutation support featureset.
8
9
The `StructuralTangent` constructor returns a `MutableTangent` for mutable structs.
9
10
`MutableTangent` is an experimental feature.
10
11
Thus use of `StructuralTangent` (rather than `Tangent` directly) is also experimental.
@@ -409,7 +410,7 @@ This type represents the tangent to a mutable struct.
409
410
It itself is also mutable.
410
411
411
412
!!! warning Exprimental
412
- MutableTangent is an experimental feature.
413
+ MutableTangent is an experimental feature, and is part of the mutation support featureset .
413
414
While this notice remains it may have changes in behavour, and interface in any _minor_ version of ChainRulesCore.
414
415
Exactly how it should be used (e.g. is it forward-mode only?)
415
416
@@ -440,4 +441,10 @@ function Base.setproperty!(tangent::MutableTangent, idx::Int, x)
440
441
return setproperty! (tangent, name, x)
441
442
end
442
443
443
- idx2sym (:: NamedTuple{names} , idx) where names = names[idx]
444
+ idx2sym (:: NamedTuple{names} , idx) where names = names[idx]
445
+
446
+ Base. hash (tangent:: MutableTangent , h:: UInt64 ) = hash (backing (tangent), h)
447
+ function Base.:(== )(t1:: MutableTangent{T1} , t2:: MutableTangent{T2} ) where {T1, T2}
448
+ typeintersect (T1, T2) == Union{} && return false
449
+ backing (t1)== backing (t2)
450
+ end
0 commit comments