torch_real: Real

View source: R/gen-namespace.R

torch_realR Documentation

Real

Description

Real

Usage

torch_real(self)

Arguments

self

(Tensor) the input tensor.

real(input) -> Tensor

Returns the real part of the input tensor. If input is a real (non-complex) tensor, this function just returns it.

Warning

Not yet implemented for complex tensors.

\mbox{out}_{i} = real(\mbox{input}_{i})

Examples

if (torch_is_installed()) {
## Not run: 
torch_real(torch_tensor(c(-1 + 1i, -2 + 2i, 3 - 3i)))

## End(Not run)
}

torch documentation built on June 7, 2023, 6:19 p.m.