code: def trainable_lu_factorization(
      event_size, batch_shape=(), seed=None, dtype=tf.float32, name=None
  ):
      with tf.name_scope(name or "trainable_lu_factorization"):
          event_size = tf.convert_to_tensor(
              value=event_size, dtype_hint=tf.int32, name="event_size"
          )
          batch_shape = tf.convert_to_tensor(
              value=batch_shape,
              dtype_hint=event_size.dtype,
              name="batch_shape",
          )
          random_matrix = tf.random.uniform(
              shape=tf.concat(
                  [batch_shape, [event_size, event_size]], axis=0
              ),
              dtype=dtype,
              seed=seed,
          )
          random_orthonormal = tf.linalg.qr(random_matrix)[0]
          lower_upper, permutation = tf.linalg.lu(random_orthonormal)
          lower_upper = tf.Variable(
              initial_value=lower_upper,
              trainable=True,
              name="lower_upper",
          )
          # Initialize a non-trainable variable for the permutation indices so
          # that its value isn't re-sampled from run-to-run.
          permutation = tf.Variable(
              initial_value=permutation,
              trainable=False,
              name="permutation",
          )
          return lower_upper, permutation
  
file_path: probability/tensorflow_probability/python/bijectors/scale_matvec_lu_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import scale_matvec_lu
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 1 for calling a global function with example usage: trainable_lu_factorization(event_size, batch_shape, seed, dtype, name) and returns: lower_upper,  permutation