diagonalEmbedding
Creates a tensor whose diagonals of certain 2D planes (specified by dim1 and dim2) are filled by diagonalEntries. To facilitate creating batched diagonal matrices, the 2D planes formed by the last two dimensions of the returned tensor are chosen by default.
The argument offset controls, which diagonal to consider:
If offset = 0, it is the main diagonal.
If offset 0, it is above the main diagonal.
If offset < 0, it is below the main diagonal.
The size of the new matrix will be calculated to make the specified diagonal of the size of the last input dimension. For more information: https://pytorch.org/docs/stable/generated/torch.diag_embed.html
Return
tensor whose diagonals of certain 2D planes (specified by dim1 and dim2) are filled by diagonalEntries
Parameters
the input tensor. Must be at least 1-dimensional.
which diagonal to consider. Default: 0 (main diagonal).
first dimension with respect to which to take diagonal. Default: -2.
second dimension with respect to which to take diagonal. Default: -1.