Public
Edited
May 30, 2024
Paused
Insert cell
Insert cell
Insert cell
Insert cell
pt(tf.tensor1d([1, 2, 3]).toString())
Insert cell
Insert cell
Insert cell
pt(tf.tensor2d([[1, 2, 3], [4, 5, 6]]).toString())
Insert cell
Insert cell
pt(tf.tensor([[[1], [2], [3]], [[4], [5], [6]]]).toString())
Insert cell
pt(tf.rand([2, 2], () => Math.random()).toString())
Insert cell
pt(tf.ones([2, 2]).toString())
Insert cell
pt(tf.zeros([2, 2]).toString())
Insert cell
pt(tf.range(0, 9, 2).toString())
Insert cell
pt(tf.linspace(0, 9, 10).toString())
Insert cell
pt(tf.fill([2, 2], 4).toString())
Insert cell
pt(tf.eye(3, 3).toString())
Insert cell
Insert cell
t1 = tf.tensor([[[1], [2], [3]], [[4], [5], [6]]])
Insert cell
t1.shape
Insert cell
pt(t1.reshape([3, 2, 1]).toString())
Insert cell
Insert cell
pt(t1.reshape([2, 3]).toString())
Insert cell
Insert cell
tf.cast(t1, "float32").dtype
Insert cell
pt(tf.broadcastTo(t1, [2, 3, 3]).toString())
Insert cell
pt(tf.tensor([1, 2, 3]).pad([[2, 1]]).toString())
Insert cell
Insert cell
pt(tf.einsum('ij,jk->ik', t2, t3).toString())
Insert cell
t2 = tf.rand([10, 10], () => Math.random())
Insert cell
t3 = tf.rand([10, 10], () => Math.random())
Insert cell
Insert cell
pt(tf.einsum('i,i->', t4, t5).toString())
Insert cell
t4 = tf.rand([10], () => Math.random())
Insert cell
t5 = tf.rand([10], () => Math.random())
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more