learning.as_complex#
- bartorch.learning.as_complex()#
Combine a leading axis of real and imaginary parts into a complex tensor.
Inverse of
as_real().- Parameters:
input (torch.Tensor) – Real, with a leading axis of length two.
- Returns:
Complex, of shape
input.shape[1:].- Return type:
torch.Tensor
- Raises:
TypeError –
inputis complex.ValueError – The leading axis is not of length two.