
Last chance! 50% off unlimited learning
Sale ends in
Thresholds each element of the input Tensor.
nn_threshold(threshold, value, inplace = FALSE)
The value to threshold at
The value to replace with
can optionally do the operation in-place. Default: FALSE
Input: *
means, any number of additional
dimensions
Output:
Threshold is defined as:
if (torch_is_installed()) {
m <- nn_threshold(0.1, 20)
input <- torch_randn(2)
output <- m(input)
}
Run the code above in your browser using DataLab