Read Understanding Swift for TensorFlow. A little bit outdated. This followed with fix.