code: def _randomize(coeffs, radixes, seed=None):
      """Applies the Owen (2017) randomization to the coefficients."""
      given_dtype = coeffs.dtype
      coeffs = tf.cast(coeffs, dtype=tf.int32)
      num_coeffs = ps.shape(coeffs)[-1]
      perms = _get_permutations(
          num_coeffs, np.squeeze(radixes, axis=-1), seed=seed
      )
      perms = tf.reshape(perms, shape=[-1])
      radixes = tf.reshape(tf.cast(radixes, dtype=tf.int32), shape=[-1])
      radix_sum = tf.reduce_sum(radixes)
      radix_offsets = tf.reshape(
          tf.cumsum(radixes, exclusive=True), shape=[-1, 1]
      )
      offsets = (
          radix_offsets
          + ps.range(num_coeffs, dtype=tf.int32) * radix_sum
      )
      permuted_coeffs = tf.gather(perms, coeffs + offsets)
      return tf.cast(permuted_coeffs, dtype=given_dtype)
  
file_path: probability/tensorflow_probability/python/mcmc/sample_halton_sequence_lib.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
label_desc: Use image node_id 2 for calling a global function with example usage: _randomize(coeffs, radixes, seed) and returns: tf