tf.linalg.lu_reconstruct

View source on GitHub

The reconstruct one or more matrices from their LU decomposition(s).

tf.linalg.lu_reconstruct(
    lower_upper, perm, validate_args=False, name=None
)

Args:

Returns:

Examples

import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp

x = [[[3., 4], [1, 2]],
     [[7., 8], [3, 4]]]
x_reconstructed = tf.linalg.lu_reconstruct(*tf.linalg.lu(x))
tf.assert_near(x, x_reconstructed)
# ==> True