
    BVh                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ  ed	g
       e	j                  dd      dd              Zy)z%SavedModel simple save functionality.    )ops)builder)signature_constants)signature_def_utils)tag_constants)deprecation)	tf_exportzsaved_model.simple_save)v1NzThis API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.c                 <   t         j                  t        j                  ||      i}t	        j
                  |      }|j                  | t        j                  g|t        j                  t        j                  j                        |d       |j                          y)a  Convenience function to build a SavedModel suitable for serving.

  In many common cases, saving models for serving will be as simple as:

      simple_save(session,
                  export_dir,
                  inputs={"x": x, "y": y},
                  outputs={"z": z})

  Although in many cases it's not necessary to understand all of the many ways
      to configure a SavedModel, this method has a few practical implications:
    - It will be treated as a graph for inference / serving (i.e. uses the tag
      `saved_model.SERVING`)
    - The SavedModel will load in TensorFlow Serving and supports the
      [Predict
      API](https://github.com/tensorflow/serving/blob/master/tensorflow_serving/apis/predict.proto).
      To use the Classify, Regress, or MultiInference APIs, please see the
      [SavedModel
      APIs](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md).
    - Some TensorFlow ops depend on information on disk or other information
      called "assets". These are generally handled automatically by adding the
      assets to the `GraphKeys.ASSET_FILEPATHS` collection. Only assets in that
      collection are exported; if you need more custom behavior, you'll need to
      use the
      [SavedModelBuilder](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/builder.py).

  More information about SavedModel and signatures can be found here:
  https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md.

  Args:
    session: The TensorFlow session from which to save the meta graph and
        variables.
    export_dir: The path to which the SavedModel will be stored.
    inputs: dict mapping string input names to tensors. These are added
        to the SignatureDef as the inputs.
    outputs:  dict mapping string output names to tensors. These are added
        to the SignatureDef as the outputs.
    legacy_init_op: Legacy support for op or group of ops to execute after the
        restore op upon a load.
  T)tagssignature_def_mapassets_collectionmain_opclear_devicesN)r   !DEFAULT_SERVING_SIGNATURE_DEF_KEYr   predict_signature_defr   SavedModelBuilderadd_meta_graph_and_variablesr   SERVINGr   get_collection	GraphKeysASSET_FILEPATHSsave)session
export_dirinputsoutputslegacy_init_opr   bs          Y/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/saved_model/simple_save.pysimple_saver!      s    ^ ;;

3
3FG
D 
+!  !!")**3==+H+HI !  &&(    )N)__doc__tensorflow.python.frameworkr   tensorflow.python.saved_modelr   r   r   r   tensorflow.python.utilr    tensorflow.python.util.tf_exportr	   
deprecatedr!    r"   r    <module>r*      s\    , + 1 = = 7 . 6 ()*EF5	F +
5r"   