There are multiple backends in TensorFlow.js. The backend is an underlying platform where we can execute operations in the graph. Every backend has the same interface so that the application running on top of it doesn't need to take care of the backend in most cases. TensorFlow.js operations are designed to be sufficiently abstract to hide the low-level implementation in the background.
But if our primary interest is performance, then things are different. Each backend implementation has different performance characteristics. Some make use of the available hardware acceleration properties as much as possible, but others don't. To maximize the performance of our application, we need to be familiar with the details of the backend implementation.
TensorFlow.js supports the following backend implementations:
- CPU (pure JavaScript)
- WebGL
- WebGPU...