Adds two tf.Tensors element-wise, A + B. Supports broadcasting.
tf.Tensor
const a = tf.tensor1d([1, 2, 3, 4]);const b = tf.tensor1d([10, 20, 30, 40]);a.add(b).print(); // or tf.add(a, b) Copy
const a = tf.tensor1d([1, 2, 3, 4]);const b = tf.tensor1d([10, 20, 30, 40]);a.add(b).print(); // or tf.add(a, b)
// Broadcast add a with b.const a = tf.scalar(5);const b = tf.tensor1d([10, 20, 30, 40]);a.add(b).print(); // or tf.add(a, b) Copy
// Broadcast add a with b.const a = tf.scalar(5);const b = tf.tensor1d([10, 20, 30, 40]);a.add(b).print(); // or tf.add(a, b)
The first tf.Tensor to add.
The second tf.Tensor to add. Must have the same type as a.
a
Adds two
tf.Tensor
s element-wise, A + B. Supports broadcasting.