Tensorflow.js Shape Backend
This is a backend for Tensorflow.js that just computes the shapes and dtypes of tensors.
This could be used to build an editor extension that lets you get the shape of a tensor on hover, or to build asynchronous computation backends (Tensorflow.js needs to know the shape of tensors synchronously, but is fine with the actual computation being asynchronous).
Usage
tf const ones = tfconst pooled = tf console/** should print something like * Tensor { isDisposedInternal: false, size: 2500, shape: [ 10, 5, 5, 10 ], dtype: 'float32', strides: [ 250, 50, 10 ], dataId: {}, id: 3, rankType: '4' } */
Or
const shape dtype = // shape === [10, 5, 5, 10]// dtype === 'float32'
TODO
- Implement
- BatchToSpaceND & SpaceToBatchND
- More tests
- Better name for
shapesOnly