torch.linalg.lstsq
torch.linalg.lstsq(A, B, rcond=None, *, driver=None)
Computes a solution to the least squares problem of a system of
   linear equations.
Letting \mathbb{K} be \mathbb{R} or \mathbb{C}, the least squares
   problem for a linear system AX = B with A \in \mathbb{K}^{m
   \times n}, B \in \mathbb{K}^{m \times k} is defined as
  \min_{X \in \mathbb{K}^{n \times k}} \|AX - B\|_F

where |-|_F denotes the Frobenius norm.
Supports inputs of float, double, cfloat and cdouble dtypes. Also
   supports batches of matrices, and if the inputs are batches of
   matrices then the output has the same batch dimensions.
"driver" chooses the backend function that will be used. For CPU
   inputs the valid values are 'gels', 'gelsy', 'gelsd,
   'gelss'. To choose the best driver on CPU consider:

If "A" is well-conditioned (its condition number is not too
     large), or you do not mind some precision loss.
