mirror of
https://github.com/apple/swift-numerics
synced 2026-11-25 04:47:53 +00:00
Merge remote-tracking branch 'upstream/swift-5.3'
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user