tf.keras.ops.pinv
Stay organized with collections
Save and categorize content based on your preferences.
Compute the (Moore-Penrose) pseudoinverse of a matrix.
tf.keras.ops.pinv(
x, rcond=None
)
The pseudoinverse is computed via the singular value decomposition
(SVD). Singular values smaller than rcond times the largest
singular value (per matrix, in the batched case) are treated as zero.
Args |
x
|
Input tensor of shape (..., M, N).
|
rcond
|
Cutoff ratio for small singular values. Singular values
less than or equal to rcond * largest_singular_value are
set to zero. If None (default), the backend's own default
is used.
|
Returns |
A tensor of shape (..., N, M) containing the pseudoinverse
of each matrix in x.
|
Example:
a = keras.ops.convert_to_tensor([[1., 2.], [3., 4.], [5., 6.]])
keras.ops.pinv(a) @ a
array([[1., 0.],
[0., 1.]], dtype=float32)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2026-10-31 UTC.
[null,null,["Last updated 2026-10-31 UTC."],[],[]]