lu as returned by tf.linalg.lu, i.e., if matmul(P,
matmul(L, U)) = X then lower_upper = L + U - eye.
perm
p as returned by tf.linag.lu, i.e., if matmul(P, matmul(L, U)) =
X then perm = argmax(P).
validate_args
Python bool indicating whether arguments should be checked
for correctness. Note: this function does not verify the implied matrix is
actually invertible, even when validate_args=True.
Default value: False (i.e., don't validate arguments).
name
Python str name given to ops managed by this object.
Default value: None (i.e., 'lu_matrix_inverse').
Returns
inv_x
The matrix_inv, i.e.,
tf.matrix_inverse(tf.linalg.lu_reconstruct(lu, perm)).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.linalg.lu_matrix_inverse\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/ops/linalg/linalg_impl.py#L1035-L1097) |\n\nComputes the inverse given the LU decomposition(s) of one or more matrices.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.linalg.lu_matrix_inverse`](https://www.tensorflow.org/api_docs/python/tf/linalg/lu_matrix_inverse)\n\n\u003cbr /\u003e\n\n tf.linalg.lu_matrix_inverse(\n lower_upper, perm, validate_args=False, name=None\n )\n\nThis op is conceptually identical to, \n\n inv_X = tf.lu_matrix_inverse(*tf.linalg.lu(X))\n tf.assert_near(tf.matrix_inverse(X), inv_X)\n # ==\u003e True\n\n| **Note:** this function does not verify the implied matrix is actually invertible nor is this condition checked even when `validate_args=True`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `lower_upper` | `lu` as returned by [`tf.linalg.lu`](../../tf/linalg/lu), i.e., if `matmul(P, matmul(L, U)) = X` then `lower_upper = L + U - eye`. |\n| `perm` | `p` as returned by `tf.linag.lu`, i.e., if `matmul(P, matmul(L, U)) = X` then `perm = argmax(P)`. |\n| `validate_args` | Python `bool` indicating whether arguments should be checked for correctness. Note: this function does not verify the implied matrix is actually invertible, even when `validate_args=True`. Default value: `False` (i.e., don't validate arguments). |\n| `name` | Python `str` name given to ops managed by this object. Default value: `None` (i.e., 'lu_matrix_inverse'). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---------|--------------------------------------------------------------------------------|\n| `inv_x` | The matrix_inv, i.e., `tf.matrix_inverse(tf.linalg.lu_reconstruct(lu, perm))`. |\n\n\u003cbr /\u003e\n\n#### Examples\n\n import numpy as np\n import tensorflow as tf\n import tensorflow_probability as tfp\n\n x = [[[3., 4], [1, 2]],\n [[7., 8], [3, 4]]]\n inv_x = tf.linalg.lu_matrix_inverse(*tf.linalg.lu(x))\n tf.assert_near(tf.matrix_inverse(x), inv_x)\n # ==\u003e True"]]