This is a list of questions we frequently get and problems that are often encountered. Because this project is still in development, we have missing pieces that are commonly encountered and prefer not to get new issues filed in our bug tracker.
- Why Swift?
- How can I use Python 3 with the Python module?
- [Mac] I wrote some code in an Xcode Playground. Why is it frozen/hanging?
The short answer is that our decision was driven by the needs of the core Graph Program Extraction compiler transformation that started the whole project. We have a long document that explains all of this rationale in depth named "Why Swift for TensorFlow?".
Separate from that, Swift really is a great fit for our purposes, and a very nice language.
By default, Swift will use the highest version of Python available on your system. You can dynamically switch Python versions by calling:
PythonLibrary.useVersion(2, 7)
On macOS, Python 2.7 comes pre-installed and cannot be modified without disabling SIP. You can, however, install Python 3 from Python.org.
Xcode Playgrounds are known to be somewhat unstable, unfortunately. If your Playground appears to hang, please try restarting Xcode or creating a new Playground.