Native Tensor support

Michał Wadas michalwadas at gmail.com
Sun Jan 28 14:08:17 UTC 2018


Why should be it included in standard library?

Are there widely used  libraries providing similar capabilities?

Why is it preferable to implementing tensor operations in Web Assembly?


On 27 Jan 2018 2:50 am, "Robert Eisele" <robert at xarg.org> wrote:

Hello,

Allocating multi-dimensional arrays in Javascript is only possible by
building each dimension individually. In addition to being a very tedious
job, a developer has no control over memory usage, which in general is
likely to be very high.

Seeing an array algebraically as a vector, typed arrays have already
created the ability to work more efficiently and memory-consciously with
lists of numbers. A natural extension of this is not just a matrix, but a
tensor.

I would like to suggest tensors as a native language construct in ES. This
would have the advantage that developers could write highly parallelizable
code independently of WebGL. As an API one could introduce the following
classes in analogy to typed arrays:

- IntXTensor
- UintXTensor
- FloatXTensor

Where X is one of {8, 16, 32, 64}. To make these tensor objects really
effective, it is necessary to introduce meaningful operations, maybe
similar to the features of TensorFlow. I think by introducing tensors in
the browser (but also node.js), a wide range of new applications open up.
For example, working with deep learning right in the browser or calculating
filters on images without having to write shaders for them.

The most important thing probably is having a way of storing high
dimensional data in the browser without worrying about the memory
footprint, even for complex applications.

What do you think about it?

Robert Eisele

_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180128/3452e138/attachment.html>


More information about the es-discuss mailing list