class_docstr: Python test for quantization ops.
class_docstr_tok: ["Python","test","for","quantization","ops","."]
code: def test_difference_is_at_most_one(self, dtype):
      values = tf.random.uniform((100,), -100.0, 100.0, dtype=dtype)
      rounded = gen_ops.stochastic_round(values, 1.0, ())
      self.assertEqual(rounded.dtype, tf.int32)
      self.assertAllClose(values, rounded, atol=1, rtol=0)
  
file_path: compression/tensorflow_compression/python/ops/quantization_ops_test.py
imports: import time
  from absl.testing import parameterized
  import tensorflow
  from tensorflow_compression.python.ops import gen_ops
label_desc: Use image node_id 1 for calling the QuantizationOpsTest obj's underlying member method code with example usage: obj.test_difference_is_at_most_one(dtype) without return types