def transform_raw_features(
      self,
      raw_features: Mapping[str, common_types.TensorType],
      drop_unused_features: bool = True  # LEGACY_VALUE=False
  ) -> Dict[str, common_types.TensorType]:
    """Takes a dict of tensors representing raw features and transforms them.

    Takes a dictionary of `Tensor`, `SparseTensor`, or `RaggedTensor`s that
    represent the raw features, and applies the transformation defined by
    tf.Transform.

    If False it returns all transformed features defined by tf.Transform. To
    only return features transformed from the given 'raw_features', set
    `drop_unused_features` to True.

    Note: If eager execution is enabled and this API is invoked inside a
    tf.function or an API that uses tf.function such as dataset.map, please use
    `transform_features_layer` instead. It separates out loading of the
    transform graph and hence resources will not be initialized on each
    invocation. This can have significant performance improvement if the
    transform graph was exported as a TF1 SavedModel and guarantees correctness
    if it was exported as a TF2 SavedModel.

    Args:
      raw_features: A dict whose keys are feature names and values are
      `Tensor`s, `SparseTensor`s, or `RaggedTensor`s.
      drop_unused_features: If True, the result will be filtered. Only the
        features that are transformed from 'raw_features' will be included in
        the returned result. If a feature is transformed from multiple raw
        features (e.g, feature cross), it will only be included if all its base
        raw features are present in `raw_features`.

    Returns:
      A dict whose keys are feature names and values are `Tensor`s,
      `SparseTensor`s, or `RaggedTensor`s representing transformed features.
    """
    if self._exported_as_v1:
      transformed_features = self._transform_raw_features_compat_v1(
          raw_features, drop_unused_features)
    else:
      tft_layer = self.transform_features_layer()
      if not drop_unused_features:
        tf.compat.v1.logging.warning(
            'Unused features are always dropped in the TF 2.x '
            'implementation. Ignoring value of drop_unused_features.')

      transformed_features = tft_layer(raw_features)
    return _TransformedFeaturesDict(transformed_features)
Takes a dict of tensors representing raw features and transforms them.

    Takes a dictionary of `Tensor`, `SparseTensor`, or `RaggedTensor`s that
    represent the raw features, and applies the transformation defined by
    tf.Transform.

    If False it returns all transformed features defined by tf.Transform. To
    only return features transformed from the given 'raw_features', set
    `drop_unused_features` to True.

    Note: If eager execution is enabled and this API is invoked inside a
    tf.function or an API that uses tf.function such as dataset.map, please use
    `transform_features_layer` instead. It separates out loading of the
    transform graph and hence resources will not be initialized on each
    invocation. This can have significant performance improvement if the
    transform graph was exported as a TF1 SavedModel and guarantees correctness
    if it was exported as a TF2 SavedModel.

    Args:
      raw_features: A dict whose keys are feature names and values are
      `Tensor`s, `SparseTensor`s, or `RaggedTensor`s.
      drop_unused_features: If True, the result will be filtered. Only the
        features that are transformed from 'raw_features' will be included in
        the returned result. If a feature is transformed from multiple raw
        features (e.g, feature cross), it will only be included if all its base
        raw features are present in `raw_features`.

    Returns:
      A dict whose keys are feature names and values are `Tensor`s,
      `SparseTensor`s, or `RaggedTensor`s representing transformed features.
    
tensorflow_transform/output_wrapper.py