UNPKG
@waynew/boa
Version:
latest (2.1.3)
2.1.3
2.1.2
2.1.1
2.1.0
Use Python modules seamlessly in Node.js
github.com/alibaba/pipcook
alibaba/pipcook
@waynew/boa
/
example
/
tf2
/
hello.js
11 lines
(7 loc)
•
236 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
'use strict'
;
const
boa =
require
(
'../../'
);
const
tf = boa.
import
(
'tensorflow'
);
const
n1 = tf.
add
(
1
,
2
).
numpy
();
console
.
log
(n1);
// 3
const
n2 = tf.
constant
(
'Hello, TensorFlow!'
).
numpy
();
console
.
log
(n2);
// b'Hello, TensorFlow!'