I need to create a block diagonal matrix, where the block are repeated on the diagonal many times. I would like to do something analogous to this numpy code
import numpy as np

S = np.arange(9).reshape((3, 3))
M = np.kron(np.eye(4), S)
M += np.kron(np.eye(4, 4, 1), S.T)
print(M)

Is there something similar in Pytorch or it is not yet implemented? Will it ever be implemented if that is the case