Python wrappers
Public Python APIs implemented by this engine symbol.Compute the Moore-Penrose pseudoinverse of a rectangular matrix.
Shape
- Input
a:(..., m, n). - Output:
(..., n, m).
Parameters
aTensorImplPtrInput matrix of shape
(..., m, n) with leading batch dims. Need not be square or full rank. Must be at least 2-D and have a floating-point dtype.Returns
TensorImplPtrThe pseudoinverse of shape (..., n, m) — the last two dimensions are swapped relative to the input.
Raises
:runtime_errorIf
a is null, has a non-floating-point dtype, or has fewer than two dimensions.Notes
Internally a full reduced SVD is computed; if the caller already has the SVD on hand, forming manually avoids the redundant factorisation.
Examples
>>> // Solve a tall least-squares system via the pseudoinverse:
>>> auto x_impl = matmul_op(pinv_op(a_impl), b_impl);