torch_view_as_complex: View_as_complex

View source: R/gen-namespace.R

torch_view_as_complexR Documentation

View_as_complex

Description

View_as_complex

Usage

torch_view_as_complex(self)

Arguments

self

(Tensor) the input tensor.

view_as_complex(input) -> Tensor

Returns a view of input as a complex tensor. For an input complex tensor of size m1, m2, \dots, mi, 2, this function returns a new complex tensor of size m1, m2, \dots, mi where the last dimension of the input tensor is expected to represent the real and imaginary components of complex numbers.

Warning

torch_view_as_complex is only supported for tensors with torch_dtype torch_float64() and torch_float32(). The input is expected to have the last dimension of size 2. In addition, the tensor must have a stride of 1 for its last dimension. The strides of all other dimensions must be even numbers.

Examples

if (torch_is_installed()) {
if (FALSE) {
x=torch_randn(c(4, 2))
x
torch_view_as_complex(x)
}
}

torch documentation built on May 29, 2024, 9:54 a.m.