dpnp.dpnp_array.dpnp_array.diagonal

method

dpnp_array.diagonal(offset=0, axis1=0, axis2=1)[source]

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])