Returns (a - b) * (a - b) element-wise. Supports broadcasting.
const a = tf.tensor1d([1, 4, 3, 16]);const b = tf.tensor1d([1, 2, 9, 4]);a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) Copy
const a = tf.tensor1d([1, 4, 3, 16]);const b = tf.tensor1d([1, 2, 9, 4]);a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)
// Broadcast squared difference a with b.const a = tf.tensor1d([2, 4, 6, 8]);const b = tf.scalar(5);a.squaredDifference(b).print(); // or tf.squaredDifference(a, b) Copy
// Broadcast squared difference a with b.const a = tf.tensor1d([2, 4, 6, 8]);const b = tf.scalar(5);a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)
The first tensor.
The second tensor. Must have the same type as a.
a
Generated using TypeDoc
Returns (a - b) * (a - b) element-wise. Supports broadcasting.