This older post provides some approaches using direct indexing to fill the diagonal with a tensor.
1 Like
This older post provides some approaches using direct indexing to fill the diagonal with a tensor.