Polar
torch_polar(abs, angle)
abs
: (Tensor) The absolute value the complex tensor. Must be float or double.angle
: (Tensor) The angle of the complex tensor. Must be same dtype as abs
.Constructs a complex tensor whose elements are Cartesian coordinates corresponding to the polar coordinates with absolute value abs
and angle angle
.
if (torch_is_installed()) { abs <- torch_tensor(c(1, 2), dtype=torch_float64()) angle <- torch_tensor(c(pi / 2, 5 * pi / 4), dtype=torch_float64()) z <- torch_polar(abs, angle) z }
Useful links