Skip to content

Files

Latest commit

964debd · Feb 25, 2021

History

History
This branch is 3 commits ahead of, 1647 commits behind tensorflow/tfjs:master.

tfjs-backend-webgl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 16, 2021
Feb 25, 2021
Apr 10, 2020
Apr 10, 2020
Jun 3, 2020
Sep 23, 2020
Nov 25, 2020
Jan 28, 2021
Jan 15, 2021
Apr 10, 2020
Apr 27, 2020
Apr 10, 2020
Jan 28, 2021

README.md

Usage

This package implements a GPU accelerated WebGL backend for 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 WebGL backend to the global backend registry.
import '@tensorflow/tfjs-backend-webgl';

Via a script tag

<!-- Import @tensorflow/tfjs-core -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>

<!-- Adds the WebGL backend to the global backend registry -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl"></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 WebGL backend to the global backend registry -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl@2.0.0-rc.4/dist/tf-backend-webgl.es2017.js"></script>