def _build_analysis_graph_for_inspection(preprocessing_fn, specs, dataset_keys,
                                         input_cache, force_tf_compat_v1):
  """Builds the analysis graph for inspection."""
  if not force_tf_compat_v1:
    assert all([isinstance(s, tf.TypeSpec) for s in specs.values()]), specs
  graph, structured_inputs, structured_outputs = (
      impl_helper.trace_preprocessing_function(
          preprocessing_fn,
          specs,
          use_tf_compat_v1=tf2_utils.use_tf_compat_v1(force_tf_compat_v1)))

  transform_fn_future, cache_dict, _ = build(
      graph,
      structured_inputs,
      structured_outputs,
      dataset_keys=dataset_keys,
      cache_dict=input_cache)
  return transform_fn_future, cache_dict
Builds the analysis graph for inspection.
tensorflow_transform/beam/analysis_graph_builder.py