chainer.functions.maximum¶
- chainer.functions.maximum(x1, x2)[source]¶
Element-wise maximum of input variables.
- Parameters
x1 (
Variable
or N-dimensional array) – Input variables to be compared. A \((s_1, s_2, ..., s_N)\) -shaped float array.x2 (
Variable
or N-dimensional array) – Input variables to be compared. A \((s_1, s_2, ..., s_N)\) -shaped float array.
- Returns
Output variable.
- Return type
Example
>>> x1 = np.arange(6).astype(np.float32) >>> x1 array([0., 1., 2., 3., 4., 5.], dtype=float32) >>> x2 = np.array([5, 4, 3, 2, 1, 0]).astype(np.float32) >>> x2 array([5., 4., 3., 2., 1., 0.], dtype=float32) >>> y = F.maximum(x1, x2) >>> y.shape (6,) >>> y.array array([5., 4., 3., 3., 4., 5.], dtype=float32)