dpnp.ndarray.diagonal

method

ndarray.diagonal(offset=0, axis1=0, axis2=1)

Return specified diagonals.

Refer to dpnp.diagonal for full documentation.

See also

dpnp.diagonal

Equivalent function.

Examples

>>> import dpnp as np
>>> a = np.arange(4).reshape(2,2)
>>> a.diagonal()
array([0, 3])