tfjs/tfjs-backend-cpu
Linchenn db099a493d
Add Draw API (#7628)
FEATURE

* add draw

* add tests

* add comments

* lint

* upd

* typo

* cmt

* rename contextOption to canvasOption

* Update tfjs-core/src/ops/browser.ts

Co-authored-by: Matthew Soulanille <matthew@soulanille.net>

* Update tfjs-core/src/ops/draw_test.ts

Co-authored-by: Matthew Soulanille <matthew@soulanille.net>

* warn once

* lint

* unify options

* typo

* tune

* tune

* tune

* typo

---------

Co-authored-by: Matthew Soulanille <matthew@soulanille.net>
2023-05-06 16:51:17 -07:00
..
.vscode
scripts
src Add Draw API (#7628) 2023-05-06 16:51:17 -07:00
.npmignore
.npmrc
.nycrc
BUILD.bazel Add Draw API (#7628) 2023-05-06 16:51:17 -07:00
README.md
package.json
tsconfig.json
yarn.lock

README.md

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>