maximum¶
- tripy.maximum(lhs: Tensor, rhs: Tensor) Tensor [source]¶
Performs an elementwise maximum.
- Parameters:
- Returns:
[dtype=T1] A new tensor with the broadcasted shape.
- Return type:
Example
1a = tp.Tensor([1.0, 6.0]) 2b = tp.Tensor([2.0, 3.0]) 3output = tp.maximum(a, b)
>>> a tensor([1.0000, 6.0000], dtype=float32, loc=gpu:0, shape=(2,)) >>> b tensor([2.0000, 3.0000], dtype=float32, loc=gpu:0, shape=(2,)) >>> output tensor([2.0000, 6.0000], dtype=float32, loc=gpu:0, shape=(2,))