meddlr.ops.complex.channels_first#
- meddlr.ops.complex.channels_first(x: Tensor)[source]#
Permute complex-valued
xto channels-first convention.For complex values, there are two potential conventions:
xis complex-valued:(B,...,C)->(B, C, ...).The real and imaginary components are stored in the last dimension.
(B,...,C,2)->(B, C, ..., 2).
- Parameters
x (torch.Tensor) – A complex-valued tensor of shape
(B,...,C)or a real-valued tensor of shape(B,...,C,2).- Returns
- A channels-first tensor. If
xis complex, this will also be complex. If
xis the real-view of a complex tensor, this will also be the real view.
- A channels-first tensor. If
- Return type
torch.Tensor