# tensorplay.functional.view_as_real Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.view_as_real.html ```python tensorplay.functional.view_as_real(input) → Tensor ``` Returns a view of input as a real tensor. For an input complex tensor of size $m1, m2, \dots, mi$, this function returns a new real tensor of size $m1, m2, \dots, mi, 2$, where the last dimension of size 2 represents the real and imaginary components of complex numbers. > **Warning** > > view_as_real() is only supported for tensors with complex dtypes. Parameters: input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the input tensor. Example: ``` >>> x=tensorplay.randn(4, dtype=tensorplay.cfloat) >>> x tensor([(0.4737-0.3839j), (-0.2098-0.6699j), (0.3470-0.9451j), (-0.5174-1.3136j)]) >>> tensorplay.view_as_real(x) tensor([[ 0.4737, -0.3839], [-0.2098, -0.6699], [ 0.3470, -0.9451], [-0.5174, -1.3136]]) ```