code: def batch_invert_permutation(permutations):
      """Returns batched `tf.invert_permutation` for every row in `permutations`."""
      unpacked = tf.unstack(permutations)
      inverses = [
          tf.math.invert_permutation(permutation)
          for permutation in unpacked
      ]
      return tf.stack(inverses)
  
file_path: sonnet/sonnet/src/nets/dnc/util.py
imports: import numpy
  import tensorflow
  import tree
label_desc: Use image node_id 2 for calling a global function with example usage: batch_invert_permutation(permutations) and returns: tf