triu

dragon.vm.torch.triu(
  input,
  diagonal=0,
  out=None
)[source]

Return the upper triangular part of input.

\[\text{out}_{ij} = \begin{cases} 0, & \text{ if } j < i + k \\ \text{input}_{ij}, & \text{ otherwise } \end{cases} \]

Examples:

x = torch.ones(3, 3)
print(torch.triu(x))
Parameters:
Returns:

dragon.vm.torch.Tensor – The output tensor.