code: def test_stochastic_tensor_raises(self):
      with self.assertRaisesRegexp(TypeError, "stochastic"):
          stages_impl.UniformQuantizationEncodingStage(
              stochastic=tf.constant(True, dtype=tf.bool)
          )
  
imports: import itertools
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.stages import stages_impl
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.testing import test_utils
label_desc: Use image node_id 16 for calling the UniformQuantizationEncodingStageStageTest obj's underlying member method code with example usage: obj.test_stochastic_tensor_raises() without return types