code: def to_tensor_spec(input_spec, default_dtype=None):
      """Converts a Keras InputSpec object to a TensorSpec."""
      default_dtype = default_dtype or backend.floatx()
      if isinstance(input_spec, InputSpec):
          dtype = input_spec.dtype or default_dtype
          return tensor_spec.TensorSpec(
              to_tensor_shape(input_spec), dtype
          )
      return tensor_spec.TensorSpec(None, default_dtype)
  
file_path: tensorflow/tensorflow/python/keras/engine/input_spec.py
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.keras import backend
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 4 for calling a global function with example usage: to_tensor_spec(input_spec, default_dtype) and returns: tensor_spec, tensor_spec