I have two tensors with shapes [n, d, d] and [n, 1], respectively, and I would like to add the latter to the diagonals of the matrices in the former.  What’s the most straightforward way of doing it?  It shouldn’t be in-place.
LE: I’m curious if there’s a better way than stacking torch.eyes.