code: def _invert_permutation(
      perm,
  ):  # TODO(b/130217510): Remove this function.
      return tf.cast(tf.argsort(perm, axis=-1), perm.dtype)
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 4 for calling a global function with example usage: _invert_permutation(perm) and returns: tf