Returns the maximum value of all elements in the x tensor.

tch_max(x, dim = NULL, keepdim = FALSE, other = NULL)

Arguments

x

tensor object

dim

the dimension to reduce

keepdim

wether to keep or not the dim

other

a tensor.

Examples

x <- tensor(runif(100)) tch_max(x)
#> tensor #> 0.996033 #> [ Variable[CPUFloatType]{} ]