code: def _reconstruct_matrix(eigenvalues, eigenvectors, indices=None):
      """Builds submatrix w/ corresponding eigendecomposition at position `indices`.
  
      Args:
        eigenvalues: A Tensor of shape `[batch_shape, n]`.
        eigenvectors: A Tensor of shape `[batch_shape, d, n]`.
        indices: A boolean Tensor of shape `[d]`.
  
      Returns:
        matrix: A Tensor of shape `[batch_shape, d, d]` with `k` rows and
          columns not pinned to the identity, where `k` is the number of `True`
          elements in `indices`. (The remaining `d - k` rows/columns have `1`'s on
          the diagonal and `0`'s elsewhere.)
      """
      offset = 0
      if indices is not None:
          mask = tf.cast(indices, eigenvectors.dtype)
          eigenvectors = mask[..., tf.newaxis] * eigenvectors
          offset = 1.0 - mask
          # TODO(bjp): Consider similar fast path to _sample_from_edpp: gather active
          #     coordinates to the front, padding with diag(ones), then slicing to the
          #     size of the largest submatrix in the batch.
      result = tf.matmul(
          eigenvectors * eigenvalues[..., tf.newaxis, :],
          eigenvectors,
          transpose_b=True,
      )
      # To ensure the logdet is not -inf, we add `1`s along the diagonal of the
      # masked rows/columns.
      return tf.linalg.set_diag(
          result, tf.linalg.diag_part(result) + offset
      )
  
imports: import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.gram_schmidt import gram_schmidt
  from tensorflow.python.ops import control_flow_util
label_desc: Use image node_id 2 for calling a global function with example usage: _reconstruct_matrix(eigenvalues, eigenvectors, indices) and returns: tf