def analyze_in_place(preprocessing_fn, force_tf_compat_v1, feature_specs,
                     type_specs, transform_output_path):
  """Analyzes the `preprocessing_fn` in-place without looking at the data.

  This should only be used if the `preprocessing_fn` contains no TFT
  analyzers or TFT mappers that use analyzers.

  Writes out a transform function and transformed metadata to subdirs under
  `transform_output_path`.

  Args:
    preprocessing_fn: The tf.Transform preprocessing_fn.
    force_tf_compat_v1: If True, call Transform's API to use Tensorflow in
      tf.compat.v1 mode.
    feature_specs: a Dict from input feature key to its feature spec.
    type_specs: a Dict from input feature key to its type spec.
    transform_output_path: An absolute path to write the output to.

  Raises:
    RuntimeError if `preprocessing_fn` contains TFT analyzers.
  """
  use_tf_compat_v1 = tf2_utils.use_tf_compat_v1(force_tf_compat_v1)
  transform_fn_path = os.path.join(transform_output_path,
                                   TFTransformOutput.TRANSFORM_FN_DIR)
  if use_tf_compat_v1:
    graph, structured_inputs, structured_outputs = (
        trace_preprocessing_function(
            preprocessing_fn, feature_specs, use_tf_compat_v1=use_tf_compat_v1))
    _assert_no_analyzers_in_graph(graph)
    with tf.compat.v1.Session(graph=graph) as sess:
      sess.run(tf.compat.v1.global_variables_initializer())
      sess.run(tf.compat.v1.tables_initializer())
      saved_transform_io.write_saved_transform_from_session(
          sess, structured_inputs, structured_outputs, transform_fn_path)

      transformed_metadata = dataset_metadata.DatasetMetadata(
          schema=schema_inference.infer_feature_schema(structured_outputs,
                                                       graph, sess))
  else:
    concrete_transform_fn = _trace_and_write_transform_fn(
        saved_model_dir=transform_fn_path,
        preprocessing_fn=preprocessing_fn,
        input_signature=type_specs,
        base_temp_dir=None,
        tensor_replacement_map=None,
        output_keys_to_name_map=None,
        save_options=None)
    _assert_no_analyzers_in_graph(concrete_transform_fn.graph)
    structured_inputs = tf2_utils.get_structured_inputs_from_func_graph(
        concrete_transform_fn.graph)
    transformed_metadata = _trace_and_get_metadata(
        concrete_transform_fn=concrete_transform_fn,
        structured_inputs=structured_inputs,
        preprocessing_fn=preprocessing_fn,
        base_temp_dir=None,
        tensor_replacement_map=None)
  transformed_metadata_dir = os.path.join(
      transform_output_path, TFTransformOutput.TRANSFORMED_METADATA_DIR)
  metadata_io.write_metadata(transformed_metadata, transformed_metadata_dir)
Analyzes the `preprocessing_fn` in-place without looking at the data.

  This should only be used if the `preprocessing_fn` contains no TFT
  analyzers or TFT mappers that use analyzers.

  Writes out a transform function and transformed metadata to subdirs under
  `transform_output_path`.

  Args:
    preprocessing_fn: The tf.Transform preprocessing_fn.
    force_tf_compat_v1: If True, call Transform's API to use Tensorflow in
      tf.compat.v1 mode.
    feature_specs: a Dict from input feature key to its feature spec.
    type_specs: a Dict from input feature key to its type spec.
    transform_output_path: An absolute path to write the output to.

  Raises:
    RuntimeError if `preprocessing_fn` contains TFT analyzers.
  
tensorflow_transform/impl_helper.py