View source: R/gen-namespace.R
torch_complex | R Documentation |
Complex
torch_complex(real, imag)
real |
(Tensor) The real part of the complex tensor. Must be float or double. |
imag |
(Tensor) The imaginary part of the complex tensor. Must be same dtype
as |
Constructs a complex tensor with its real part equal to real
and its
imaginary part equal to imag
.
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
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.