code: def _maybe_tensor_shape_from_tensor(shape):
      if isinstance(shape, tf.Tensor):
          return tf.TensorShape(tf.get_static_value(shape))
      else:
          return shape
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tf_agents.utils import common
label_desc: Use image node_id 1 for calling a global function with example usage: _maybe_tensor_shape_from_tensor(shape) and returns: tf, shape