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