Shortcuts

torch.real

torch.real(input, out=None) → Tensor

Returns the real part of the input tensor. If input is a real (non-complex) tensor, this function just returns it.

Warning

Not yet implemented for complex tensors.

outi=real(inputi)\text{out}_{i} = real(\text{input}_{i})
Parameters
  • input (Tensor) – the input tensor.

  • out (Tensor, optional) – the output tensor.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources