torch_phasor#
- ptyrad.utils.math_ops.torch_phasor(phase)[source]#
Creates a complex tensor with unit magnitude using the phase.
- Parameters:
phase (torch.Tensor) – phase angle for the exp(i*theta)
Note
This util function is created so torch.compile can properly handle complex tensors, because torch.exp(1j*phase) involves the 1j which is actually a Python built-in that can’t be traced.