code: def tensor_spec_to_shape(
      tensor_specs: Union[tf.TensorSpec, Sequence[tf.TensorSpec]]
  ):
      """Convert TensorSpec(s) to shape(s)."""
      if isinstance(tensor_specs, Sequence):
          return [spec.shape for spec in tensor_specs]
      else:
          return tensor_specs.shape
  
imports: import warnings
  from typing import Sequence, Union, Optional
  from bigdl.nano.utils.common import invalidInputError
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: tensor_spec_to_shape(tensor_specs) and returns: unknown, tensor_specs