cupy.linalg.solve#

cupy.linalg.solve(a, b)[source]#

Solves a linear matrix equation.

It computes the exact solution of x in ax = b, where a is a square and full rank matrix.

Parameters:
  • a (cupy.ndarray) – The matrix with dimension (..., M, M).

  • b (cupy.ndarray) – The matrix with dimension (M,) or (..., M, K).

Returns:

The matrix with dimension (..., M) or (..., M, K).

Return type:

cupy.ndarray

Warning

This function calls one or more cuSOLVER routine(s) which may yield invalid results if input conditions are not met. To detect these invalid results, you can set the linalg configuration to a value that is not ignore in cupyx.errstate() or cupyx.seterr().