meddlr.ops.complex.is_complex#

meddlr.ops.complex.is_complex(x)[source]#

Returns if x is a complex-tensor.

This function is a wrapper around torch.is_complex() for PyTorch<1.7. torch < 1.7 does not have the torch.is_complex directive, so we can’t call it for older PyTorch versions.

Parameters

x (torch.Tensor) – A tensor.

Returns

True if complex tensors are supported and the tensor is complex.

Return type

bool