Returns the max of a and b (a > b ? a : b) element-wise. Supports broadcasting.
a > b ? a : b
We also expose tf.maximumStrict which has the same signature as this op and asserts that a and b are the same shape (does not broadcast).
tf.maximumStrict
a
b
const a = tf.tensor1d([1, 4, 3, 16]);const b = tf.tensor1d([1, 2, 9, 4]);a.maximum(b).print(); // or tf.maximum(a, b) Copy
const a = tf.tensor1d([1, 4, 3, 16]);const b = tf.tensor1d([1, 2, 9, 4]);a.maximum(b).print(); // or tf.maximum(a, b)
// Broadcast maximum a with b.const a = tf.tensor1d([2, 4, 6, 8]);const b = tf.scalar(5);a.maximum(b).print(); // or tf.maximum(a, b) Copy
// Broadcast maximum a with b.const a = tf.tensor1d([2, 4, 6, 8]);const b = tf.scalar(5);a.maximum(b).print(); // or tf.maximum(a, b)
The first tensor.
The second tensor. Must have the same type as a.
Generated using TypeDoc
Returns the max of a and b (
a > b ? a : b
) element-wise. Supports broadcasting.We also expose
tf.maximumStrict
which has the same signature as this op and asserts thata
andb
are the same shape (does not broadcast).