torch.real
-
torch.real(input) → Tensor -
Возвращает новый тензор, содержащий действительные значения тензора
self. Возвращаемый тензор иselfиспользуют одну и ту же базовую память.- Параметры
-
input (Tensor) – входной тензор.
Пример:
>>> x=torch.randn(4, dtype=torch.cfloat) >>> x tensor([(0.3100+0.3553j), (-0.5445-0.7896j), (-1.6492-0.0633j), (-0.0638-0.8119j)]) >>> x.real tensor([ 0.3100, -0.5445, -1.6492, -0.0638])
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.real.html