Swift for TensorFlow

import TensorFlow

var x = Tensor([[1, 2], [3, 4]])

for i in 1...5 {
    x += x • x
}

print(x)

Swift for TensorFlow provides a new programming model that combines the performance of graphs with the flexibility and expressivity of eager execution, with a strong focus on improved usability at every level of the stack. Swift also catches type errors and shape mismatches before running your code, and has Automatic Differentiation built in.

We believe that machine learning tools are so important that they deserve a first-class language and a compiler. To join the developer community, see the GitHub repository

.