def fill_diagonal_(mat: T.Tensor, val: T.Scalar) -> T.Tensor:
"""
Fill the diagonal of the matirx with a specified value.
Note:
Modifies mat in place.
Args:
mat: A tensor.
val: The value to put along the diagonal.
Returns:
None
"""
numpy.fill_diagonal(mat, val)
评论列表
文章目录