Complex
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_complex.Rd
Complex
complex(real, imag, *, out=None) -> Tensor
Constructs a complex tensor with its real part equal to real
and its
imaginary part equal to imag
.
Examples
if (torch_is_installed()) {
real <- torch_tensor(c(1, 2), dtype=torch_float32())
imag <- torch_tensor(c(3, 4), dtype=torch_float32())
z <- torch_complex(real, imag)
z
z$dtype
}
#> torch_ComplexFloat