Contents:
Fill diagonal of torch tensor, batched and in-place.
x (Tensor) – [..., N, M] tensor with leading batch dimensions.
Tensor
[..., N, M]
value (float) – value to fill the diagonal with.
float
The same [..., N, M] input tensor with diagonal entries x[..., i, i] replaced.
x[..., i, i]