tf.keras.ops.diagflat

Create a two-dimensional array with the flattened input on the k-th diagonal.

x Input tensor to be flattened and placed on the diagonal.
k The diagonal to place the flattened input. Defaults to 0. Use k > 0 for diagonals above the main diagonal, and k < 0 for diagonals below the main diagonal.

A 2-D tensor with the flattened input on the specified diagonal.