@tensorflow/tfjs-backend-cpu

popular esm
Vanilla JavaScript backend for TensorFlow.js
Version 4.22.0 License Apache-2.0
INSTALL
Type:
Version:
- Static
- Latest Patch
- Latest Minor
- Latest Major
- 4.22.0
- 4.21.0
- 4.20.0
- 4.19.0
- 4.18.0
- 4.17.0
- 4.16.0
- 4.15.0
- 4.14.0
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.0
- 4.8.0
- 4.7.0
- 4.6.0
- 4.5.0
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.0
- 3.21.0
- 3.20.0
- 3.19.0
- 3.18.0
- 3.17.0
- 3.16.0
- 3.15.0
- 3.14.0
- 3.13.0
- 3.12.0
- 3.11.0
- 3.10.0
- 3.9.0
- 3.8.0
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- 2.8.6
- 2.8.5
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 4.23.0-rc.0
- 4.22.0-rc.0
- 4.21.0-rc.0
- 4.20.0-rc.0
- 4.19.0-rc.0
- 4.18.0-rc.0
- 4.17.0-rc.0
- 4.16.0-rc.0
- 4.15.0-rc.0
- 4.14.0-rc.0
- 4.13.0-rc.0
- 4.12.0-rc.0
- 3.0.0-rc.1
- 3.0.0-rc.0
- 2.0.0-rc.4
- 2.0.0-rc.3
- 2.0.0-rc.1
<script src=" https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@4.22.0/dist/tf-backend-cpu.min.js "></script>
Usage
This package implements a JavaScript based CPU backend to TensorFlow.js.
Importing the backend
Note: this backend is included by default in @tensorflow/tfjs
.
Via NPM
// Import @tensorflow/tfjs-core
import * as tf from '@tensorflow/tfjs-core';
// Adds the CPU backend to the global backend registry.
import '@tensorflow/tfjs-backend-cpu';
Via a script tag
<!-- Import @tensorflow/tfjs-core -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
<!-- Adds the CPU backend to the global backend registry -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu"></script>
You can also get ES2017 code using the following links
<!-- Import @tensorflow/tfjs-core -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core@2.0.0-rc.4/dist/tf-core.es2017.js"></script>
<!-- Adds the CPU backend to the global backend registry -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@2.0.0-rc.4/dist/tf-backend-cpu.es2017.js"></script>