(method of tensor)
convert rank 1 or rank 0 tensor into diagonal rank 2 tensor
If the input tensor has rank 0 or 1 the resulting tensor will have rank 2 with the diagonal filled with the input tensor elements. If the input tensor has rank at least two the resulting tensor has rank 1 with elements being the diagonal of the input tensor.
Synatx
T = diag(T)
T |
T |
DocHelp 0.1 beta |