torch.conj¶
- torch.conj(input) Tensor ¶
返回
input
的一个视图,其共轭位已翻转。如果input
具有非复数 dtype,则此函数仅返回input
。注意
torch.conj()
执行惰性共轭,但实际共轭张量可以使用torch.resolve_conj()
随时具体化。警告
将来,
torch.conj()
对于非复数 dtype 的input
可能会返回一个不可写视图。建议程序在input
是非复数 dtype 时,不要修改torch.conj_physical()
返回的 tensor,以兼容此更改。- 参数
input (Tensor) – 输入 tensor。
示例
>>> x = torch.tensor([-1 + 1j, -2 + 2j, 3 - 3j]) >>> x.is_conj() False >>> y = torch.conj(x) >>> y.is_conj() True