haojin2 commented on a change in pull request #16913: [numpy] add op linalg solve URL: https://github.com/apache/incubator-mxnet/pull/16913#discussion_r353574024
########## File path: python/mxnet/ndarray/numpy/linalg.py ########## @@ -352,3 +352,57 @@ def slogdet(a): (1., -1151.2925464970228) """ return _npi.slogdet(a) + + +def solve(a, b): + r""" + Solve a linear matrix equation, or system of linear scalar equations. + + Computes the "exact" solution, `x`, of the well-determined, i.e., full + rank, linear matrix equation `ax = b`. + + Parameters + ---------- + a : (..., M, M) ndarray + Coefficient matrix. + b : {(..., M,), (..., M, K)}, ndarray + Ordinate or "dependent variable" values. + + Returns + ------- + x : {(..., M,), (..., M, K)} ndarray + Solution to the system a x = b. Returned shape is identical to `b`. + + Raises + ------ + LinAlgError Review comment: Are we really raising this same error when input is singular or not square? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services