Heaviside
torch_heaviside(self, values)
self
: (Tensor) the input tensor.values
: (Tensor) The values to use where input
is zero.Computes the Heaviside step function for each element in input
. The Heaviside step function is defined as:
if (torch_is_installed()) { input <- torch_tensor(c(-1.5, 0, 2.0)) values <- torch_tensor(c(0.5)) torch_heaviside(input, values) values <- torch_tensor(c(1.2, -2.0, 3.5)) torch_heaviside(input, values) }
Useful links