Maximum
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_maximum.Rd
Maximum
Note
If one of the elements being compared is a NaN, then that element is returned.
torch_maximum()
is not supported for tensors with complex dtypes.
Examples
if (torch_is_installed()) {
a <- torch_tensor(c(1, 2, -1))
b <- torch_tensor(c(3, 0, 4))
torch_maximum(a, b)
}
#> torch_tensor
#> 3
#> 2
#> 4
#> [ CPUFloatType{3} ]