Neg
neg(input, out=NULL) -> Tensor
Returns a new tensor with the negative of the elements of input.
$$ \mbox{out} = -1 \times \mbox{input} $$
Examples
if (torch_is_installed()) {
a = torch_randn(c(5))
a
torch_neg(a)
}
#> torch_tensor
#> -1.6231
#> -0.0320
#> 0.4590
#> -0.8963
#> 0.7423
#> [ CPUFloatType{5} ]