pymc.math.maximum#
- pymc.math.maximum=Elemwise(scalar_op=maximum,inplace_pattern=<frozendict{}>)[source]#
elemwise maximum. See max for the maximum in one tensor
Computes element-wise maximum of two tensors.
- Parameters:
- x
TensorLike First input tensor
- y
TensorLike Second input tensor
- x
- Returns:
TensorLikeOutput tensor with the maximum of corresponding elements in x and y
Notes
This computes the element-wise maximum, whilemax(x) computes themaximum value over all elements in a single tensor.
Examples
>>>importpytensor>>>importpytensor.tensoraspt>>>a=pt.vector("a")>>>b=pt.vector("b")>>>f=pytensor.function([a,b],pt.maximum(a,b))>>>f([1,3,5],[2,3,4])array([2, 3, 5])
