code: def shape_to_tuple(shape):
      if isinstance(shape, tf.TensorShape):
          if shape.ndims is not None:
              return tuple([dim.value for dim in shape.dims])
          return None
  
      if isinstance(shape, tf.Dimension):
          return shape.value
  
      if isinstance(shape, list):
          return [shape_to_tuple(s) for s in shape]
  
      if isinstance(shape, tuple):
          return tuple([shape_to_tuple(s) for s in shape])
  
      return shape
  
file_path: neupy/neupy/utils/tf_utils.py
imports: from functools import wraps
  import numpy
  import tensorflow
  from neupy.utils.misc import as_tuple
  from neupy.utils.processing import asfloat
label_desc: Use image node_id 14 for calling a global function with example usage: shape_to_tuple(shape) and returns: shape, None, shape, unknown, tuple, tuple