tensorflow / swift-models

Models and examples built with Swift for TensorFlow
Apache License 2.0
648 stars 148 forks source link

Initial compatibility with stock toolchain #722

Closed BradLarson closed 3 years ago

BradLarson commented 3 years ago

This provides the needed Numerics dependency, as well as missing _Differentiation imports, to support building while using a stock toolchain with swift-apis. For now, the AnyLayer type has been gated off from the stock toolchain until it can be reworked to support the new VectorProtocol.

To build this successfully under Swift Package Manager with the stock toolchain, you'll need to provide the TENSORFLOW_USE_STANDARD_TOOLCHAIN flag:

swift build -Xswiftc -D TENSORFLOW_USE_STANDARD_TOOLCHAIN

This is needed to avoid a conflict caused by the use of Numerics in the stock toolchain. CMake should detect this automatically, and does not require any additional command-line options.