torch.conj#
- torch.conj(input) Tensor#
Returns a view of
inputwith a flipped conjugate bit. Ifinputhas a non-complex dtype, this function just returnsinput.Note
torch.conj()performs a lazy conjugation, but the actual conjugated tensor can be materialized at any time usingtorch.resolve_conj().Warning
In the future,
torch.conj()may return a non-writeable view for aninputof non-complex dtype. It’s recommended that programs not modify the tensor returned bytorch.conj_physical()wheninputis of non-complex dtype to be compatible with this change.- Parameters
input (Tensor) – the input tensor.
Example:
>>> x = torch.tensor([-1 + 1j, -2 + 2j, 3 - 3j]) >>> x.is_conj() False >>> y = torch.conj(x) >>> y.is_conj() True