code: def _randomize(coeffs, radixes, seed, perms=None):
      """Applies the Owen (2017) randomization to the coefficients."""
      given_dtype = coeffs.dtype
      coeffs = tf.cast(coeffs, dtype=tf.int32)
      num_coeffs = _NUM_COEFFS_BY_DTYPE[given_dtype]
      radixes = tf.reshape(tf.cast(radixes, dtype=tf.int32), shape=[-1])
      if perms is None:
          perms = _get_permutations(num_coeffs, radixes, seed)
          perms = tf.reshape(perms, shape=[-1])
      radix_sum = tf.reduce_sum(input_tensor=radixes)
      radix_offsets = tf.reshape(
          tf.cumsum(radixes, exclusive=True), shape=[-1, 1]
      )
      offsets = radix_offsets + tf.range(num_coeffs) * radix_sum
      permuted_coeffs = tf.gather(perms, coeffs + offsets)
      return tf.cast(permuted_coeffs, dtype=given_dtype), perms
  
file_path: tf-quant-finance/tf_quant_finance/math/random_ops/halton/halton_impl.py
imports: import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.math.random_ops import stateless
label_desc: Use image node_id 2 for calling a global function with example usage: _randomize(coeffs, radixes, seed, perms) and returns: tf,  perms