CVTensor

class complextorch._cvtensor.CVTensor(r: Tensor, i: Tensor)

Complex-Valued Tensor

Lightweight complex-valued Rensor class. Built on the PyTorch Tensor with many similar properties and methods.

property H

Hermitian transpose of the complex tensor.

property T

Transpose of the complex tensor.

abs()

Absolute value of the complex tensor.

add_(other)

Addition of two complex tensors inplace.

angle()

Angle of the complex tensor.

clone()

Clone the complex tensor.

property complex

Return the complex tensor in complex form.

property conj

Conjugate of the complex tensor.

conjugate()

Conjugate of the complex tensor.

contiguous(memory_format=torch.contiguous_format)

Make the complex tensor contiguous.

cpu()

Move the complex tensor to the CPU.

cuda(device=None, non_blocking=False)

Move the complex tensor to the GPU.

detach()

Detach the complex tensor from the computation graph.

property device

Device of the complex tensor.

dim()

Dimension of the complex tensor.

div_(other)

Elementwise division of two complex tensors inplace.

property dtype

Data type of the complex tensor.

expand(*sizes, **kwargs)

Expand the complex tensor.

expand_as(other)

Expand the complex tensor as another tensor.

fft(n=None, dim=-1, norm='ortho')

FFT of the complex tensor.

fft_(n=None, dim=-1, norm='ortho')

In-place FFT of the complex tensor.

flatten(start_dim=0, end_dim=-1)

Flatten the complex tensor.

classmethod from_numpy(x: ndarray)

Create a complex tensor from a numpy array.

h()

Hermitian transpose of the complex tensor.

ifft(n=None, dim=-1, norm='ortho')

Inverse FFT of the complex tensor.

ifft_(n=None, dim=-1, norm='ortho')

In-place inverse FFT of the complex tensor.

is_complex()

Check if the complex tensor is complex.

item()

Get the scalar value of the complex tensor if it is zero-dim.

mean(dim=None, keepdim=False)

Mean of the complex tensor.

mul_(other)

Multiplication of two complex tensors inplace.

numpy()

Convert the complex tensor to a numpy array.

permute(*dims)

Permute the complex tensor.

property polar

Return the complex tensor in polar form.

property rect

Return the complex tensor in rectangular form.

requires_grad_(requires_grad=True)

Set the requires_grad attribute of the complex tensor.

reshape(*shape)

Reshape the complex tensor.

roll(shifts, dims=None)

Same as torch.roll() but for CVTensor.

property shape

“Shape of the complex tensor.

size(*dim)

Size of the complex tensor.

squeeze(dim=None)

Squeeze the complex tensor.

sub_(other)

Subtraction of two complex tensors inplace.

sum(dim=None, keepdim=False)

Sum of the complex tensor.

t()

Transpose of the complex tensor.

to(*args, **kwargs)

Move the complex tensor to the specified device.

transpose(dim0, dim1)

Transpose the complex tensor.

unsqueeze(dim)

Unsqueeze the complex tensor.

view(*shape)

View the complex tensor.

view_as(other)

View the complex tensor as another tensor.