How can we check if a matrix is PSD is PyTorch?
There is a poste on checking if a matrix is PSD in Python. I am wondering how we can check it in PyTorch? is there a function for that?

Haven't found a PyTorch function for that, but you should be able to determine it easily, and similarly to the post you've linked, by checking whether the matrix is symmetric and all eigenvalues are non-negative:
def is_psd(mat):
    return bool((mat == mat.T).all() and (torch.eig(mat)[0][:,0]&gt;=0).all())
#Test:
is_psd(torch.randn(2,2))

