Multiplies two tf.Tensors element-wise, A * B. Supports broadcasting.
tf.Tensor
We also expose tf.mulStrict which has the same signature as this op and asserts that a and b are the same shape (does not broadcast).
tf.mulStrict
a
b
const a = tf.tensor1d([1, 2, 3, 4]);const b = tf.tensor1d([2, 3, 4, 5]);a.mul(b).print(); // or tf.mul(a, b) Copy
const a = tf.tensor1d([1, 2, 3, 4]);const b = tf.tensor1d([2, 3, 4, 5]);a.mul(b).print(); // or tf.mul(a, b)
// Broadcast mul a with b.const a = tf.tensor1d([1, 2, 3, 4]);const b = tf.scalar(5);a.mul(b).print(); // or tf.mul(a, b) Copy
// Broadcast mul a with b.const a = tf.tensor1d([1, 2, 3, 4]);const b = tf.scalar(5);a.mul(b).print(); // or tf.mul(a, b)
The first tensor to multiply.
The second tensor to multiply. Must have the same dtype as a.
Multiplies two
tf.Tensor
s element-wise, A * B. Supports broadcasting.We also expose
tf.mulStrict
which has the same signature as this op and asserts thata
andb
are the same shape (does not broadcast).