class_docstr: Handles a SavedModel exported using TF 1.x APIs in TF 2.x.
class_docstr_tok: ["Handles","a","SavedModel","exported","using","TF","1.x","APIs","in","TF","2.x","."]
docstr: Constructs a function that can be invoked without `unfed_input_keys`.
docstr_tok: ["Constructs","a","function","that","can","be","invoked","without","`","unfed_input_keys","`","."]
code: def _finalize_wrapped_function(
      self, unfed_input_keys: Iterable[str], fetches_keys: Iterable[str]
  ) -> function.ConcreteFunction:
      """Constructs a function that can be invoked without `unfed_input_keys`."""
      original_input_signature = (
          self._wrapped_function.structured_input_signature[0][0]
      )
      input_signature = {
          k: v
          for k, v in original_input_signature.items()
          if k not in unfed_input_keys
      }
  
      @tf.function(input_signature=[input_signature], autograph=False)
      def wrapped_finalized(inputs):
          missing_inputs = self._get_missing_inputs(
              unfed_input_keys, batch_size=1
          )
          # Directly modifying inputs is not allowed in a tf.function. Hence, we
          # make a deep copy here.
          inputs_copy = tf_utils.copy_tensors(inputs)
          inputs_copy.update(missing_inputs)
          flattened_inputs = tf.nest.flatten(
              inputs_copy, expand_composites=True
          )
          transformed_features = self._wrapped_function(
              *flattened_inputs
          )
          return {
              key: transformed_features[key] for key in fetches_keys
          }
  
      return wrapped_finalized.get_concrete_function()
  
imports: from typing import Any, Dict, Iterable, Mapping, Tuple, Union
  import tensorflow
  from tensorflow_transform import annotators
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_tools
  from tensorflow_transform import tf2_utils
  from tensorflow_transform import tf_utils
  from tensorflow_transform.py_func import pyfunc_helper
  from tensorflow_transform.saved import constants
  from tensorflow_transform.saved import saved_model_loader
  from tensorflow_transform.saved import saved_transform_io
  from tensorflow.python.eager import function
  from tensorflow.python.eager import wrap_function
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 15 for calling the SavedModelLoader obj's underlying member method code with example usage: obj._finalize_wrapped_function(unfed_input_keys, fetches_keys) and returns: wrapped_finalized, unknown