class_docstr: Well tested because this is a simple override of the base class.
code: def testVariableScaleDiagAssertions(self):
      # We test that changing the scale to be non-invertible raises an exception
      # when validate_args is True. This is really just testing the underlying
      # LinearOperator instance, but we include it to demonstrate that it works as
      # expected.
      loc = tf.constant([1.0, 1.0])
      scale_diag = tf.Variable(tf.ones(2))
      d = mvn_diag.MultivariateNormalDiag(
          loc, scale_diag=scale_diag, validate_args=True
      )
      self.evaluate(scale_diag.initializer)
      with self.assertRaises(Exception):
          with tf.control_dependencies([scale_diag.assign([1.0, 0.0])]):
              self.evaluate(d.sample(seed=test_util.test_seed()))
  
imports: import os
  from absl.testing import parameterized
  import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 21 for calling the MultivariateNormalDiagTest obj's underlying member method code with example usage: obj.testVariableScaleDiagAssertions() without return types