You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For use with modern bundlers in a frontend application, simply
22
22
23
23
```bash
24
-
npm i @tensorflow/tfjs
25
-
npm i scikitjs
24
+
npm i @tensorflow/tfjs scikitjs
26
25
```
27
26
28
27
We depend on the tensorflow library in order to make our calculations fast, but we don't ship it in our bundle.
@@ -40,16 +39,24 @@ This allows us to build a library that can be used in Deno, Node, and the browse
40
39
For Node.js users who wish to bind to the Tensorflow C++ library, simply import the tensorflow C++ version, and use that as the tf library
41
40
42
41
```bash
43
-
npm i @tensorflow/tfjs-node
44
-
npm i scikitjs
42
+
npm i @tensorflow/tfjs-node scikitjs
45
43
```
46
44
45
+
```js
46
+
consttf=require('@tensorflow/tfjs-node')
47
+
constsk=require('scikitjs')
48
+
sk.setBackend(tf)
49
+
```
50
+
51
+
Note: If you have ESM enabled (by setting type="module" in your package.json), then you can consume this libary with import / export, like in the following code block.
52
+
47
53
```js
48
54
import*astffrom'@tensorflow/tfjs-node'
49
55
import*asskfrom'scikitjs'
50
56
sk.setBackend(tf)
51
57
```
52
58
59
+
53
60
### Script src
54
61
55
62
For those that wish to use script src tags, simply
@@ -68,7 +75,7 @@ For those that wish to use script src tags, simply
0 commit comments