code: def while_with_variable_shape_inside_if(n):
      v = tf.constant([0, 0])
      i = 0
      if n > 1:
          while i < n:
              tf.autograph.experimental.set_loop_options(
                  shape_invariants=[(v, tf.TensorShape([None]))]
              )
              v = tf.concat((v, [i]), 0)
              i += 1
      else:
          v = tf.constant([1, 2, 3])
      return v
  
imports: import collections
  import itertools
  from absl.testing import parameterized
  import tensorflow
  from tensorflow.python.autograph.tests import reference_test_base
label_desc: Use image node_id 9 for calling a global function with example usage: while_with_variable_shape_inside_if(n) and returns: v