torch_neg: Neg

Description Usage Arguments neg(input, out=NULL) -> Tensor Examples

View source: R/gen-namespace.R

Description

Neg

Usage

1
torch_neg(self)

Arguments

self

(Tensor) the input tensor.

neg(input, out=NULL) -> Tensor

Returns a new tensor with the negative of the elements of input.

\mbox{out} = -1 \times \mbox{input}

Examples

1
2
3
4
5
6
if (torch_is_installed()) {

a = torch_randn(c(5))
a
torch_neg(a)
}

torch documentation built on Oct. 7, 2021, 9:22 a.m.