1.1.0 • Published 8 years ago
babel-plugin-tensorflow v1.1.0
Prototype Babel Plugin TensorFlow
Use native javascript math operators on TensorFlow objects.
Turns
tf(A * w + b);into
tf.add(tf.mul(A, w), b);And also
tf(5 * [1, 2] + [2, 2]);into
tf.add(tf.mul(tf.scalar(5), tf.tensor([1, 2])), tf.tensor([2, 2]));Install
With npm
npm install --save-dev babel-plugin-tensorflowWith yarn
yarn add --dev babel-plugin-tensorflowAnd add the plugin to your .babelrc file
{
"plugins": [
"tensorflow"
]
}Known limitations
- Currently built only for babel 7.
tfmust be the name TensorFlow is imported as.
This is still just a prototype. Suggestions and PRs are welcome!