We deprecated the `⊗` operator and the `Tensor.dot` method for established conventions for matrix multiplication and mathematical correctness. From now on, the API for matrix multiplication is `matmul`, same as Numpy and the TensorFlow Python API.
We expect to add a tensor contraction operator which has the same semantics as
tf.tensordot, and name it “dot”. Along with the new `dot`, we plan to introduce a bullet operator `•` to represent tensor dot, which can also be easily typed (at least on a Mac, with option+8). This would be a good starter project, if anyone is interested in implementing this.
2. The high-level API prototype is removed. (
commit)
Before our open-source release, we coded up a very basic prototype of high-level APIs, placed in
HighLevel.swift. The intention was to explore the programming model and discover the challenges brought by the Graph Program Extraction approach to machine learning code, e.g. lack of support for aggregate parameter updates, etc. However, APIs exposed by this file, e.g. FullyConnectedLayer and Optimizer, were nothing but confusion on open source testers, as these APIs were not supposed to be used by anyone. As a result, we completely removed these APIs from the Swift TensorFlow library.
A frequently asked question is whether high-level APIs will be part of the standard library in the compiler codebase. The answer to that is no, because high-level APIs will likely not require any compiler support. Instead, future high-level APIs in Swift will be a separate Swift Package under
github.com/tensorflow.
The core team has no plans to design high-level APIs in the short term, because it is very important to get the compiler-enabled building blocks right, including
- core APIs (the TensorFlow module)
- automatic differentiation
- device availability diagnostics
- graph-level device placement
- the constant expression model (compiler-evaluable code)
- Python interoperability
- domain-specific Swift syntax and semantics
When it’s the right time to discuss high-level APIs, the Swift for TensorFlow team will work closely with the open source community, the broader TensorFlow team, and alpha users to come up with the best design.
-Richard