Unverified Commit 70b2edb8 authored by Gaurav7888's avatar Gaurav7888 Committed by GitHub
Browse files

Replace deprecated torch.lstsq with torch.linalg.lstsq (#3918)


Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
Co-authored-by: default avatarNicolas Hug <nicolashug@fb.com>
parent 29bdcd25
......@@ -591,9 +591,9 @@ def _get_perspective_coeffs(
a_matrix[2 * i + 1, :] = torch.tensor([0, 0, 0, p1[0], p1[1], 1, -p2[1] * p1[0], -p2[1] * p1[1]])
b_matrix = torch.tensor(startpoints, dtype=torch.float).view(8)
res = torch.lstsq(b_matrix, a_matrix)[0]
res = torch.linalg.lstsq(a_matrix, b_matrix, driver='gels').solution
output: List[float] = res.squeeze(1).tolist()
output: List[float] = res.tolist()
return output
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment