locuslab / qpth

A fast and differentiable QP solver for PyTorch.

Home Page:https://locuslab.github.io/qpth/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trivial problem returns NaN

bemilio opened this issue · comments

Running the following trivial QP problem returns NaN:

import torch
from qpth.qp import QPFunction

Q = torch.tensor([[[1.]]]) 
q = torch.tensor([[1.]])
A_eq = torch.tensor([[[0.]]])
A_ineq = torch.tensor([[[0.]]])
b_ineq = torch.tensor([[0.]])
b_eq = torch.tensor([[0.]])
QPFunction(verbose=True)(Q, q, A_ineq, b_ineq, A_eq, b_eq)

Output:

iter: 1, pri_resid: nan, dual_resid: nan, mu: nan
iter: 2, pri_resid: nan, dual_resid: nan, mu: nan
iter: 3, pri_resid: nan, dual_resid: nan, mu: nan
tensor([[nan]])