A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://data-apis.org/array-api/latest/extensions/generated/array_api.linalg.diagonal.html below:

diagonal — Python array API standard 2024.12 documentation

diagonal
diagonal(x: array, /, *, offset: int = 0) array

Returns the specified diagonals of a matrix (or a stack of matrices) x.

Parameters:
  • x (array) – input array having shape (..., M, N) and whose innermost two dimensions form MxN matrices.

  • offset (int) –

    offset specifying the off-diagonal relative to the main diagonal.

    • offset = 0: the main diagonal.

    • offset > 0: off-diagonal above the main diagonal.

    • offset < 0: off-diagonal below the main diagonal.

    Default: 0.

Returns:

out (array) – an array containing the diagonals and whose shape is determined by removing the last two dimensions and appending a dimension equal to the size of the resulting diagonals. The returned array must have the same data type as x.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4