Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
<body>
<h1>TensorFlow JavaScript</h1>
<h3>Create a tensor with a datatype:</h3>
<div id="demo"></div>
<script>
const myArr = [1, 2, 3, 4];
const shape = [2, 2];
const tensorA = tf.tensor(myArr, shape, "int32");
document.getElementById("demo").innerHTML = tensorA.dtype;
</script>
</body>
</html>