class_docstr: A Keras layer for applying a tf.Transform output to input layers.
docstr: A `saved_transform_io_v2.SavedModelLoader`.
docstr_tok: ["A","`","saved_transform_io_v2.SavedModelLoader","`","."]
code: def _saved_model_loader(
      self,
  ) -> saved_transform_io_v2.SavedModelLoader:
      """A `saved_transform_io_v2.SavedModelLoader`."""
      if self._saved_model_loader_value is None:
          self._saved_model_loader_value = (
              saved_transform_io_v2.SavedModelLoader(
                  self._tft_output.transform_savedmodel_dir
              )
          )
          self._loaded_saved_model_graph = ops.get_default_graph()
  
      if tf.compat.v1.executing_eagerly_outside_functions():
          return self._saved_model_loader_value
      else:
          assert not self._exported_as_v1
          # TODO(b/149997088): Raise an exception once we no longer support using
          # the Keras layer with estimator based Trainer.
          tf.compat.v1.logging.warning(
              "Loading a TF2 SavedModel but eager mode "
              "seems disabled."
          )
          # If exported as TF2 SavedModel but not invoked in eager mode,
          # re-initialize the saved_model_loader_value as __init__ could have been
          # called in a different graph context.
          default_graph = ops.get_default_graph()
          if (
              self._loaded_saved_model_graph is None
              or self._loaded_saved_model_graph is not default_graph
          ):
              self._saved_model_loader_value = (
                  saved_transform_io_v2.SavedModelLoader(
                      self._tft_output.transform_savedmodel_dir
                  )
              )
              self._loaded_saved_model_graph = default_graph
          return self._saved_model_loader_value
  
imports: import json
  import os
  from typing import Any, Dict, List, Mapping, Optional
  import numpy
  import tensorflow
  from tensorflow_transform import common
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_tools
  from tensorflow_transform.analyzers import sanitized_vocab_filename
  from tensorflow_transform.keras_lib import tf_keras
  from tensorflow_transform.saved import saved_transform_io
  from tensorflow_transform.saved import saved_transform_io_v2
  from tensorflow_transform.tf_metadata import dataset_metadata
  from tensorflow_transform.tf_metadata import metadata_io
  from tensorflow_transform.tf_metadata import schema_utils
  from tensorflow.python.framework import ops
  from tensorflow.tools.docs import doc_controls
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 2 for calling the TransformFeaturesLayer obj's underlying member method code with example usage: obj._saved_model_loader() and returns: self, self