_maximum
maximum
¶
Get the maximum of the given tensors
.
This method can be used with Numpy data:
n1 = np.array([[2, 7, 6]])
n2 = np.array([[2, 7, 5]])
res = fe.backend.maximum(n1, n2) # [[2, 7, 6]]
This method can be used with TensorFlow tensors:
t1 = tf.constant([[2, 7, 6]])
t2 = tf.constant([[2, 7, 5]])
res = fe.backend.maximum(t1, t2) # [[2, 7, 6]]
This method can be used with PyTorch tensors:
p1 = torch.tensor([[2, 7, 6]])
p2 = torch.tensor([[2, 7, 5]])
res = fe.backend.maximum(p1, p2) # [[2, 7, 6]]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor1 |
Tensor
|
First tensor. |
required |
tensor2 |
Tensor
|
Second tensor. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
The maximum of two |
Raises:
Type | Description |
---|---|
ValueError
|
If |