class_docstr: InputCreator with tensor type specs.
  
  Example usage:
  
  ```python
  input_creator=TypeSpecInputCreator(
      {"example_feature_1": tf.TensorSpec(shape=[None, 1], dtype=tf.float32)},
      example_feature_names=["example_feature_1"])
  ```
docstr: Initializes the instance.
  
  Args:
    type_spec: A dict maps the context and example feature keys to the
      corresponding context and example type specs.
    context_feature_names: A list of context feature keys.
    example_feature_names: A list of example feature keys.
docstr_tok: ["Initializes","the","instance",".","Args",":","type_spec",":","A","dict","maps","the","context","and","example","feature","keys","to","the","corresponding","context","and","example","type","specs",".","context_feature_names",":","A","list","of","context","feature","keys",".","example_feature_names",":","A","list","of","example","feature","keys","."]
code: def __init__(
      self,
      type_spec: Dict[str, Union[tf.TensorSpec, tf.RaggedTensorSpec]],
      context_feature_names: Optional[List[str]] = None,
      example_feature_names: Optional[List[str]] = None,
  ):
      """Initializes the instance.
  
      Args:
        type_spec: A dict maps the context and example feature keys to the
          corresponding context and example type specs.
        context_feature_names: A list of context feature keys.
        example_feature_names: A list of example feature keys.
      """
      self._type_spec = type_spec
      self._context_feature_names = context_feature_names or []
      self._example_feature_names = example_feature_names or []
  
imports: import abc
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from absl import logging
  import tensorflow
  from tensorflow_ranking.python.keras import feature
  from tensorflow_ranking.python.keras import layers
label_desc: Use image node_id 1 to create a new TypeSpecInputCreator object from inherited base classes: InputCreator with example: obj = TypeSpecInputCreator(type_spec, context_feature_names, example_feature_names)