def finalize(self, input_tensor_keys: Iterable[str],
               output_tensor_keys: Iterable[str]):
    """Finalizes the set of inputs with which this SavedModel will be called.

    Note: This is not Thread-safe. Should be called prior to any calls to
    `apply_transform_model`.

    Args:
      input_tensor_keys: Set of input keys with which the SavedModel will be
        called.
      output_tensor_keys: Set of output keys that should be returned by the
        SavedModel.
    """
    self._sorted_unfed_input_keys = sorted(
        self._get_unfed_input_keys(input_tensor_keys))
    feeds = self._get_feeds(self._sorted_unfed_input_keys)
    unexpected_outputs = (
        set(output_tensor_keys) - set(self._get_fetches_keys(feeds)))
    if unexpected_outputs:
      raise ValueError(
          'Unexpected output keys requested: {}'.format(unexpected_outputs))
    self._wrapped_function_finalized = self._finalize_wrapped_function(
        self._sorted_unfed_input_keys, sorted(output_tensor_keys))
    self._is_finalized = True
Finalizes the set of inputs with which this SavedModel will be called.

    Note: This is not Thread-safe. Should be called prior to any calls to
    `apply_transform_model`.

    Args:
      input_tensor_keys: Set of input keys with which the SavedModel will be
        called.
      output_tensor_keys: Set of output keys that should be returned by the
        SavedModel.
    
tensorflow_transform/saved/saved_transform_io_v2.py