code: def testAssertionsTotalCountMutation(self):
      x = tf.Variable([5.0, 3.0, 1.0], dtype=tf.float32)
      d = negative_binomial.NegativeBinomial(
          total_count=x, probs=0.7, validate_args=True
      )
      self.evaluate(x.initializer)
      self.evaluate(d.sample(seed=test_util.test_seed()))
      with tf.control_dependencies([x.assign([-5.0, 3.0, 1.0])]):
          with self.assertRaisesOpError(
              "`total_count` has components less than or equal to 0."
          ):
              self.evaluate(d.sample(seed=test_util.test_seed()))
  
      with tf.control_dependencies([x.assign([5.0, 3.2, 1.0])]):
          with self.assertRaisesOpError(
              "`total_count` has fractional components."
          ):
              self.evaluate(d.sample(seed=test_util.test_seed()))
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import negative_binomial
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 4 for calling the NegativeBinomialFromVariableTest obj's underlying member method code with example usage: obj.testAssertionsTotalCountMutation() without return types