Skip to content

Commit 6732f38

Browse files
authored
Add docs about backends to tfjs-core readme (tensorflow#3382)
DOC
1 parent 9165805 commit 6732f38

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tfjs-backend-cpu/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Note: this backend is included by default in `@tensorflow/tfjs`.
1010

1111
```js
1212
// Import @tensorflow/tfjs-core
13-
import * as tf from '@tensorflow/tfjs';
13+
import * as tf from '@tensorflow/tfjs-core';
1414
// Adds the CPU backend to the global backend registry.
1515
import '@tensorflow/tfjs-backend-cpu';
1616
```

tfjs-backend-webgl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Note: this backend is included by default in `@tensorflow/tfjs`.
1010

1111
```js
1212
// Import @tensorflow/tfjs-core
13-
import * as tf from '@tensorflow/tfjs';
13+
import * as tf from '@tensorflow/tfjs-core';
1414
// Adds the WebGL backend to the global backend registry.
1515
import '@tensorflow/tfjs-backend-webgl';
1616
```

tfjs-core/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ import * as tfc from '@tensorflow/tfjs-core';
3131
// No Layers API.
3232
```
3333

34+
**Note**: If you are only importing the Core API, you also need to import a
35+
backend (e.g., [tfjs-backend-cpu](/tfjs-backend-cpu),
36+
[tfjs-backend-webgl](/tfjs-backend-webgl), [tfjs-backend-wasm](/tfjs-backend-wasm)).
37+
3438
For info about development, check out [DEVELOPMENT.md](/DEVELOPMENT.md).
3539

3640
## For more information

0 commit comments

Comments
 (0)