chainerx.triu

chainerx.triu(m, k=0)

Upper triangle of an array.

Returns a copy of an array with elements below the k-th diagonal zeroed.

Parameters
  • m (ndarray) – Input array.

  • k (int) – Index of the diagonal. Zero indicates the main diagonal, a positive index an upper diagonal, and a negative index a lower diagonal.

Returns

Upper triangle of m.

Return type

ndarray

See also

numpy.triu()