code: def testInvalidP(self):
      temperature = 1.0
      invalid_ps = [1.01, 2.0]
      for p in invalid_ps:
          with self.assertRaisesOpError(
              "Argument `probs` has components greater than 1."
          ):
              dist = relaxed_bernoulli.RelaxedBernoulli(
                  temperature, probs=p, validate_args=True
              )
              self.evaluate(dist.probs)
  
      invalid_ps = [-0.01, -3.0]
      for p in invalid_ps:
          with self.assertRaisesOpError(
              "Argument `probs` has components less than 0."
          ):
              dist = relaxed_bernoulli.RelaxedBernoulli(
                  temperature, probs=p, validate_args=True
              )
              self.evaluate(dist.probs)
  
      valid_ps = [0.0, 0.5, 1.0]
      for p in valid_ps:
          dist = relaxed_bernoulli.RelaxedBernoulli(
              temperature, probs=p, validate_args=True
          )
          self.assertEqual(p, self.evaluate(dist.probs))
  
imports: import numpy
  import scipy.special
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import relaxed_bernoulli
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 3 for calling the RelaxedBernoulliTest obj's underlying member method code with example usage: obj.testInvalidP() without return types