Skip to main content

Mojo function

as_interleaved_complex

as_interleaved_complex(interleaved: Symbol) -> Symbol

Reshapes the input symbolic tensor as complex from alternating (real, imag).

Args:

  • interleaved (Symbol): A symbolic tensor representing complex numbers as alternating pairs of (real, imag) real-valued numbers. Its last dimension must have an even size.

Returns:

A symbolic tensor representing the complex-valued tensor, but with the values pulled out as complex numbers. The result has the same dimensions for all dimensions except the last dimension, which is halved, and then a final dimension of size 2 representing the complex value.