class_docstr: Python test for quantization ops.
class_docstr_tok: ["Python","test","for","quantization","ops","."]
code: def test_difference_at_half_integers_is_at_most_one_half(
      self, step_size
  ):
      values = tf.range(-10, 10, dtype=tf.float32) + 0.5
      rounded = gen_ops.stochastic_round(
          step_size * values, step_size, ()
      )
      self.assertEqual(rounded.dtype, tf.int32)
      self.assertAllClose(values, rounded, atol=0.5, 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 5 for calling the QuantizationOpsTest obj's underlying member method code with example usage: obj.test_difference_at_half_integers_is_at_most_one_half(step_size) without return types