Merge remote-tracking branch 'upstream/swift-5.3'

This commit is contained in:
Stephen Canon committed 2020-08-04 08:26:26 -04:00
commit 7e032e20fc
7 files changed
+252 -9

No files matched your search

@@ -24,6 +24,16 @@ where RealType: Differentiable, RealType.TangentVector == RealType {
extension Complex
where RealType: Differentiable, RealType.TangentVector == RealType {
@derivative(of: init(_:_:))
@usableFromInline
static func _derivativeInit(
_ real: RealType,
_ imaginary: RealType
) -> (value: Complex, pullback: (Complex) -> (RealType, RealType)) {
(value: .init(real, imaginary), pullback: { v in
(v.real, v.imaginary)
})
}
@derivative(of: real)
@usableFromInline