danfo.tensorflow
Exported internal Tensoflow.js library
danfo.tensorflow
Returns:
return Tensorflow.js library

Examples

Node
Browser
1
const dfd = require("danfojs-node")
2
const tf = dfd.tensorflow
3
4
let tensor_arr = tf.tensor2d([[12, 34, 2.2, 2], [30, 30, 2.1, 7]])
5
console.log(tensor_arr)
Copied!
1
<!DOCTYPE html>
2
<html lang="en">
3
4
<head>
5
<meta charset="UTF-8">
6
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7
<!--danfojs CDN -->
8
<script src="https://cdn.jsdelivr.net/gh/opensource9ja/[email protected]/lib/bundle.js"></script>
9
<title>Document</title>
10
</head>
11
12
<body>
13
14
<script>
15
const tf = dfd.tensorflow
16
let tensor_arr = tf.tensor2d([[12, 34, 2.2, 2], [30, 30, 2.1, 7]])
17
console.log(tensor_arr)
18
19
</script>
20
</body>
21
22
</html>
Copied!
Output
1
Tensor {
2
kept: false,
3
isDisposedInternal: false,
4
shape: [ 2, 4 ],
5
dtype: 'float32',
6
size: 8,
7
strides: [ 4 ],
8
dataId: {},
9
id: 4,
10
rankType: '2'
11
}
Copied!
Last modified 13d ago
Copy link
Contents
Examples