docstr: Construct an MVN with possibly partially defined shapes.
docstr_tok: ["Construct","an","MVN","with","possibly","partially","defined","shapes","."]
code: def _construct_mvn_for_shape_tests(self, loc_shape, cov_diag_shape):
      """Construct an MVN with possibly partially defined shapes."""
      bcast_shape = tf.broadcast_static_shape(
          tf.TensorShape(loc_shape),
          tf.TensorShape(cov_diag_shape),
      )
      bcast_shape.assert_is_fully_defined()
      bcast_shape = tuple(bcast_shape.as_list())
  
      dtype = np.float32
  
      # Use a slice of the fully defined bcast_shape to make numpy parameters.
      # This ensures the parameters are (i) fully defined, (ii) the correct rank.
      loc_ = np.ones(bcast_shape[-len(loc_shape) :], dtype=dtype)
      covariance_diag_factor_ = np.ones(
          bcast_shape[-len(cov_diag_shape) :], dtype=dtype
      )
      covariance_perturb_factor_ = np.ones(
          bcast_shape[-len(cov_diag_shape) :] + (1,), dtype=dtype
      )
  
      loc = tf1.placeholder_with_default(loc_, shape=loc_shape)
      covariance_diag_factor = tf1.placeholder_with_default(
          covariance_diag_factor_, shape=cov_diag_shape
      )
      covariance_perturb_factor = tf1.placeholder_with_default(
          covariance_perturb_factor_, shape=cov_diag_shape + (1,)
      )
  
      cov_operator = tf.linalg.LinearOperatorLowRankUpdate(
          base_operator=tf.linalg.LinearOperatorDiag(
              covariance_diag_factor, is_positive_definite=True
          ),
          u=covariance_perturb_factor,
      )
      return MultivariateNormalLowRankUpdateLinearOperatorCovariance(
          loc=loc, cov_operator=cov_operator, validate_args=True
      )
  
imports: import collections
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import mvn_low_rank_update_linear_operator_covariance
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.stats import sample_stats
label_desc: Use image node_id 1 for calling the MVNLowRankUpdateCovarianceDynamicShapeTest obj's underlying member method code with example usage: obj._construct_mvn_for_shape_tests(loc_shape, cov_diag_shape) and returns: MultivariateNormalLowRankUpdateLinearOperatorCovariance