vt::tri#

template<typename T = float>
Tensor<T, 2> vt::tri(size_t m, size_t n = 0, int k = 0, const Order order = Order::C)#

Return a tensor with ones at and below the given diagonal.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • m – Number of rows in the tensor.

  • n – Number of columns in the tensor.

  • k – An offset for the sub-diagonal at and below which the tensor is filled.

  • order – The order of the tensor.

Returns:

Tensor: The result tensor.