mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Previously, two conditions were necessary to enable differentiable programming: - Using the `-enable-experimental-differentiable-programming` frontend flag. - Importing the `_Differentiation` module. Importing the `_Differentiation` module is the true condition because it contains the required compiler-known `Differentiable` protocol. The frontend flag is redundant and cumbersome. Now, the frontend flag is removed. Importing `_Differentiation` is the only condition.
14 lines
632 B
Swift
14 lines
632 B
Swift
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path %t.swiftinterface -enable-library-evolution %s
|
|
// RUN: %FileCheck %s < %t.swiftinterface
|
|
|
|
import _Differentiation
|
|
|
|
public func a(f: @differentiable (Float) -> Float) {}
|
|
// CHECK: public func a(f: @differentiable (Swift.Float) -> Swift.Float)
|
|
|
|
public func b(f: @differentiable(linear) (Float) -> Float) {}
|
|
// CHECK: public func b(f: @differentiable(linear) (Swift.Float) -> Swift.Float)
|
|
|
|
public func c(f: @differentiable (Float, @noDerivative Float) -> Float) {}
|
|
// CHECK: public func c(f: @differentiable (Swift.Float, @noDerivative Swift.Float) -> Swift.Float)
|