code: def testValidateArgs(self):
      x = make_pd(1.0, 3)
      chol_scale = chol(x)
      df_deferred = tf1.placeholder_with_default(2.0, shape=None)
      chol_scale_deferred = tf1.placeholder_with_default(
          np.float32(chol_scale), shape=chol_scale.shape
      )
  
      # In eager mode, these checks are done statically and hence
      # ValueError is returned on object construction.
      error_type = tf.errors.InvalidArgumentError
      if tf.executing_eagerly():
          error_type = ValueError
  
      # Check expensive, deferred assertions.
      with self.assertRaisesRegexp(error_type, "cannot be less than"):
          chol_w = wishart.WishartTriL(
              df=df_deferred,
              scale_tril=chol_scale_deferred,
              validate_args=True,
          )
          self.evaluate(
              chol_w.log_prob(np.asarray(x, dtype=np.float32))
          )
  
      with self.assertRaisesOpError("`scale_tril` must be square."):
          chol_w = wishart.WishartTriL(
              df=4.0,
              scale_tril=np.array(
                  [[2.0, 3.0, 4.0], [1.0, 2.0, 3.0]], dtype=np.float32
              ),
              validate_args=True,
          )
          self.evaluate(chol_w.scale())
  
      # Ensure no assertions.
      df_deferred = tf1.placeholder_with_default(4.0, shape=None)
      chol_scale_deferred = tf1.placeholder_with_default(
          np.float32(chol_scale), shape=chol_scale.shape
      )
      chol_w = wishart.WishartTriL(
          df=df_deferred,
          scale_tril=chol_scale_deferred,
          validate_args=False,
      )
      self.evaluate(chol_w.log_prob(np.asarray(x, dtype=np.float32)))
  
      chol_scale_deferred = tf1.placeholder_with_default(
          np.ones([3, 3], dtype=np.float32), shape=[3, 3]
      )
      chol_w = wishart.WishartTriL(
          df=df_deferred,
          scale_tril=chol_scale_deferred,
          validate_args=False,
      )
      # Bogus log_prob, but since we have no checks running... c'est la vie.
      self.evaluate(chol_w.log_prob(np.asarray(x, dtype=np.float32)))
  
imports: import numpy
  from scipy import linalg
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import wishart
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 18 for calling the WishartTest obj's underlying member method code with example usage: obj.testValidateArgs() without return types