code: def expand_dims(axis, name=None):
      """Like `tf.expand_dims` but accepts a vector of axes to expand."""
  
      def expand_dims_(x):
          """Implementation of `expand_dims`."""
          with tf.name_scope(name or "expand_dims"):
              x = tf.convert_to_tensor(x, name="x")
              new_axis = tf.convert_to_tensor(
                  axis, dtype_hint=tf.int32, name="axis"
              )
              nx = ps.rank(x)
              na = ps.size(new_axis)
              is_neg_axis = new_axis < 0
              k = ps.reduce_sum(ps.cast(is_neg_axis, new_axis.dtype))
              new_axis = ps.where(is_neg_axis, new_axis + nx, new_axis)
              new_axis = ps.sort(new_axis)
              axis_neg, axis_pos = ps.split(new_axis, [k, -1])
              idx = ps.argsort(
                  ps.concat(
                      [
                          axis_pos,
                          ps.range(nx),
                          axis_neg,
                      ],
                      axis=0,
                  ),
                  stable=True,
              )
              shape = ps.pad(
                  ps.shape(x), paddings=[[na - k, k]], constant_values=1
              )
              shape = ps.gather(shape, idx)
              return tf.reshape(x, shape)
  
      return expand_dims_
  
imports: import collections
  import contextlib
  import functools
  import sys
  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 tensorshape_util
label_desc: Use image node_id 9 for calling a global function with example usage: expand_dims(axis, name) and returns: expand_dims_, tf