class_docstr: Python test for range coding ops.
  
  Coding ops have C++ tests. This Python test just ensures that the Python
  binding is not broken.
class_docstr_tok: ["Python","test","for","range","coding","ops",".","Coding","ops","have","C++","tests",".","This","Python","test","just","ensures","that","the","Python","binding","is","not","broken","."]
code: def test_readme_example(self):
      data = tf.random.uniform((128, 128), 0, 10, dtype=tf.int32)
      histogram = tf.math.bincount(data, minlength=10, maxlength=10)
      cdf = tf.cumsum(histogram, exclusive=False)
      cdf = tf.pad(cdf, [[1, 0]])
      cdf = tf.reshape(cdf, [1, 1, -1])
  
      data = tf.cast(data, tf.int16)
      encoded = gen_ops.range_encode(data, cdf, precision=14)
      decoded = gen_ops.range_decode(
          encoded, tf.shape(data), cdf, precision=14
      )
  
      self.assertAllEqual(data, decoded)
  
imports: import tensorflow
  from tensorflow_compression.python.ops import gen_ops
label_desc: Use image node_id 1 for calling the RangeCodingOpsTest obj's underlying member method code with example usage: obj.test_readme_example() without return types