code: def _expand_to_rank(vector, rank):
      """Expands a batched scalar to a tensor of certain rank."""
      return tf.reshape(vector, shape=[-1] + [1] * (rank - 1))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import neural_structured_learning.configs
  import six
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: _expand_to_rank(vector, rank) and returns: tf