meddlr.ops.complex.is_complex_as_real#
- meddlr.ops.complex.is_complex_as_real(x)[source]#
Returns
Trueif the tensor follows the real-view convention for complex numbers.The real-view of a complex tensor has the shape […, 2].
- Parameters
x (torch.Tensor) – A tensor.
- Returns
Trueif the tensor follows the real-view conventionfor complex numbers.
- Return type
bool
Note
We recommend using complex tensors instead of the real-view convention. This function cannot interpret if the last dimension has a size of
2because it is the real-imaginary channel or for some other reason.