dpctl.tensor.usm_ndarray.real

usm_ndarray.real

Returns view into real component for arrays with complex data-types and returns itself for all other data-types.

Example:
from dpctl import tensor

# Create complex array from
# arrays of real and imaginary parts

re = tensor.linspace(-1, 1, num=100, dtype="f4")
im = tensor.full_like(re, fill_value=tensor.pi)

z = tensor.empty_like(re, dtype="c8")
z.real[:] = re
z.imag[:] = im