From f943364eb8df6e56b889432172f0e74cda4ae4b2 Mon Sep 17 00:00:00 2001 From: Anna R Date: Mon, 15 Oct 2018 17:45:08 -0700 Subject: [PATCH] Updating constant endpoints. PiperOrigin-RevId: 217239829 --- tensorflow/python/framework/dtypes.py | 55 +++++----- tensorflow/python/framework/versions.py | 57 +++++++--- tensorflow/python/saved_model/constants.py | 69 ++++++++---- .../python/saved_model/signature_constants.py | 84 +++++++++++---- .../python/saved_model/tag_constants.py | 26 +++-- .../tools/api/generator/api_init_files.bzl | 4 +- .../tools/api/generator/api_init_files_v1.bzl | 1 + .../api/golden/v1/tensorflow.dtypes.pbtxt | 100 ++++++++++++++++++ .../tools/api/golden/v1/tensorflow.pbtxt | 4 + .../golden/v1/tensorflow.saved_model.pbtxt | 96 +++++++++++++++++ .../api/golden/v1/tensorflow.sysconfig.pbtxt | 8 ++ .../api/golden/v1/tensorflow.version.pbtxt | 27 +++++ .../api/golden/v2/tensorflow.dtypes.pbtxt | 100 ++++++++++++++++++ .../tools/api/golden/v2/tensorflow.pbtxt | 36 +------ .../v2/tensorflow.saved_model.constants.pbtxt | 39 ------- .../golden/v2/tensorflow.saved_model.pbtxt | 96 +++++++++++++++-- ...flow.saved_model.signature_constants.pbtxt | 47 -------- ...tensorflow.saved_model.tag_constants.pbtxt | 19 ---- .../api/golden/v2/tensorflow.sysconfig.pbtxt | 8 ++ .../api/golden/v2/tensorflow.version.pbtxt | 27 +++++ 20 files changed, 669 insertions(+), 234 deletions(-) create mode 100644 tensorflow/tools/api/golden/v1/tensorflow.version.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.saved_model.constants.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.saved_model.signature_constants.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.saved_model.tag_constants.pbtxt create mode 100644 tensorflow/tools/api/golden/v2/tensorflow.version.pbtxt diff --git a/tensorflow/python/framework/dtypes.py b/tensorflow/python/framework/dtypes.py index 64d3b42d89d..e36643b338e 100644 --- a/tensorflow/python/framework/dtypes.py +++ b/tensorflow/python/framework/dtypes.py @@ -322,57 +322,59 @@ dtype_range = { # Define standard wrappers for the types_pb2.DataType enum. resource = DType(types_pb2.DT_RESOURCE) -tf_export("resource").export_constant(__name__, "resource") +tf_export("dtypes.resource", "resource").export_constant(__name__, "resource") variant = DType(types_pb2.DT_VARIANT) -tf_export("variant").export_constant(__name__, "variant") +tf_export("dtypes.variant", "variant").export_constant(__name__, "variant") float16 = DType(types_pb2.DT_HALF) -tf_export("float16").export_constant(__name__, "float16") +tf_export("dtypes.float16", "float16").export_constant(__name__, "float16") half = float16 -tf_export("half").export_constant(__name__, "half") +tf_export("dtypes.half", "half").export_constant(__name__, "half") float32 = DType(types_pb2.DT_FLOAT) -tf_export("float32").export_constant(__name__, "float32") +tf_export("dtypes.float32", "float32").export_constant(__name__, "float32") float64 = DType(types_pb2.DT_DOUBLE) -tf_export("float64").export_constant(__name__, "float64") +tf_export("dtypes.float64", "float64").export_constant(__name__, "float64") double = float64 -tf_export("double").export_constant(__name__, "double") +tf_export("dtypes.double", "double").export_constant(__name__, "double") int32 = DType(types_pb2.DT_INT32) -tf_export("int32").export_constant(__name__, "int32") +tf_export("dtypes.int32", "int32").export_constant(__name__, "int32") uint8 = DType(types_pb2.DT_UINT8) -tf_export("uint8").export_constant(__name__, "uint8") +tf_export("dtypes.uint8", "uint8").export_constant(__name__, "uint8") uint16 = DType(types_pb2.DT_UINT16) -tf_export("uint16").export_constant(__name__, "uint16") +tf_export("dtypes.uint16", "uint16").export_constant(__name__, "uint16") uint32 = DType(types_pb2.DT_UINT32) -tf_export("uint32").export_constant(__name__, "uint32") +tf_export("dtypes.uint32", "uint32").export_constant(__name__, "uint32") uint64 = DType(types_pb2.DT_UINT64) -tf_export("uint64").export_constant(__name__, "uint64") +tf_export("dtypes.uint64", "uint64").export_constant(__name__, "uint64") int16 = DType(types_pb2.DT_INT16) -tf_export("int16").export_constant(__name__, "int16") +tf_export("dtypes.uint16", "int16").export_constant(__name__, "int16") int8 = DType(types_pb2.DT_INT8) -tf_export("int8").export_constant(__name__, "int8") +tf_export("dtypes.int8", "int8").export_constant(__name__, "int8") string = DType(types_pb2.DT_STRING) -tf_export("string").export_constant(__name__, "string") +tf_export("dtypes.string", "string").export_constant(__name__, "string") complex64 = DType(types_pb2.DT_COMPLEX64) -tf_export("complex64").export_constant(__name__, "complex64") +tf_export("dtypes.complex64", "complex64").export_constant( + __name__, "complex64") complex128 = DType(types_pb2.DT_COMPLEX128) -tf_export("complex128").export_constant(__name__, "complex128") +tf_export("dtypes.complex128", "complex128").export_constant( + __name__, "complex128") int64 = DType(types_pb2.DT_INT64) -tf_export("int64").export_constant(__name__, "int64") +tf_export("dtypes.int64", "int64").export_constant(__name__, "int64") bool = DType(types_pb2.DT_BOOL) # pylint: disable=redefined-builtin -tf_export("bool").export_constant(__name__, "bool") +tf_export("dtypes.bool", "bool").export_constant(__name__, "bool") qint8 = DType(types_pb2.DT_QINT8) -tf_export("qint8").export_constant(__name__, "qint8") +tf_export("dtypes.qint8", "qint8").export_constant(__name__, "qint8") quint8 = DType(types_pb2.DT_QUINT8) -tf_export("quint8").export_constant(__name__, "quint8") +tf_export("dtypes.quint8", "quint8").export_constant(__name__, "quint8") qint16 = DType(types_pb2.DT_QINT16) -tf_export("qint16").export_constant(__name__, "qint16") +tf_export("dtypes.qint16", "qint16").export_constant(__name__, "qint16") quint16 = DType(types_pb2.DT_QUINT16) -tf_export("quint16").export_constant(__name__, "quint16") +tf_export("dtypes.quint16", "quint16").export_constant(__name__, "quint16") qint32 = DType(types_pb2.DT_QINT32) -tf_export("qint32").export_constant(__name__, "qint32") +tf_export("dtypes.qint32", "qint32").export_constant(__name__, "qint32") resource_ref = DType(types_pb2.DT_RESOURCE_REF) variant_ref = DType(types_pb2.DT_VARIANT_REF) bfloat16 = DType(types_pb2.DT_BFLOAT16) -tf_export("bfloat16").export_constant(__name__, "bfloat16") +tf_export("dtypes.bfloat16", "bfloat16").export_constant(__name__, "bfloat16") float16_ref = DType(types_pb2.DT_HALF_REF) half_ref = float16_ref float32_ref = DType(types_pb2.DT_FLOAT_REF) @@ -650,7 +652,8 @@ _QUANTIZED_DTYPES_NO_REF = frozenset([qint8, quint8, qint16, quint16, qint32]) _QUANTIZED_DTYPES_REF = frozenset( [qint8_ref, quint8_ref, qint16_ref, quint16_ref, qint32_ref]) QUANTIZED_DTYPES = _QUANTIZED_DTYPES_REF.union(_QUANTIZED_DTYPES_NO_REF) -tf_export("QUANTIZED_DTYPES").export_constant(__name__, "QUANTIZED_DTYPES") +tf_export("dtypes.QUANTIZED_DTYPES", "QUANTIZED_DTYPES").export_constant( + __name__, "QUANTIZED_DTYPES") _PYTHON_TO_TF = { float: float32, diff --git a/tensorflow/python/framework/versions.py b/tensorflow/python/framework/versions.py index 472ccbcac7a..37f2b37b31e 100644 --- a/tensorflow/python/framework/versions.py +++ b/tensorflow/python/framework/versions.py @@ -29,30 +29,59 @@ __cxx11_abi_flag__ = pywrap_tensorflow.__cxx11_abi_flag__ __monolithic_build__ = pywrap_tensorflow.__monolithic_build__ VERSION = __version__ -tf_export("VERSION", "__version__").export_constant(__name__, "VERSION") +tf_export( + "version.VERSION", + "__version__", + v1=["version.VERSION", "VERSION", "__version__"]).export_constant( + __name__, "VERSION") GIT_VERSION = __git_version__ -tf_export("GIT_VERSION", "__git_version__").export_constant( - __name__, "GIT_VERSION") +tf_export( + "version.GIT_VERSION", + "__git_version__", + v1=["version.GIT_VERSION", "GIT_VERSION", + "__git_version__"]).export_constant(__name__, "GIT_VERSION") COMPILER_VERSION = __compiler_version__ -tf_export("COMPILER_VERSION", "__compiler_version__").export_constant( - __name__, "COMPILER_VERSION") +tf_export( + "version.COMPILER_VERSION", + "__compiler_version__", + v1=["version.COMPILER_VERSION", "COMPILER_VERSION", + "__compiler_version__"]).export_constant(__name__, "COMPILER_VERSION") + CXX11_ABI_FLAG = __cxx11_abi_flag__ -tf_export("CXX11_ABI_FLAG", "__cxx11_abi_flag__").export_constant( - __name__, "CXX11_ABI_FLAG") +tf_export( + "sysconfig.CXX11_ABI_FLAG", + "__cxx11_abi_flag__", + v1=["sysconfig.CXX11_ABI_FLAG", "CXX11_ABI_FLAG", + "__cxx11_abi_flag__"]).export_constant(__name__, "CXX11_ABI_FLAG") MONOLITHIC_BUILD = __monolithic_build__ -tf_export("MONOLITHIC_BUILD", "__monolithic_build__").export_constant( - __name__, "MONOLITHIC_BUILD") +tf_export( + "sysconfig.MONOLITHIC_BUILD", + "__monolithic_build__", + v1=[ + "sysconfig.MONOLITHIC_BUILD", "MONOLITHIC_BUILD", "__monolithic_build__" + ]).export_constant(__name__, "MONOLITHIC_BUILD") GRAPH_DEF_VERSION = pywrap_tensorflow.GRAPH_DEF_VERSION -tf_export("GRAPH_DEF_VERSION").export_constant(__name__, "GRAPH_DEF_VERSION") +tf_export( + "version.GRAPH_DEF_VERSION", + v1=["version.GRAPH_DEF_VERSION", "GRAPH_DEF_VERSION"]).export_constant( + __name__, "GRAPH_DEF_VERSION") GRAPH_DEF_VERSION_MIN_CONSUMER = ( pywrap_tensorflow.GRAPH_DEF_VERSION_MIN_CONSUMER) -tf_export("GRAPH_DEF_VERSION_MIN_CONSUMER").export_constant( - __name__, "GRAPH_DEF_VERSION_MIN_CONSUMER") +tf_export( + "version.GRAPH_DEF_VERSION_MIN_CONSUMER", + v1=[ + "version.GRAPH_DEF_VERSION_MIN_CONSUMER", + "GRAPH_DEF_VERSION_MIN_CONSUMER" + ]).export_constant(__name__, "GRAPH_DEF_VERSION_MIN_CONSUMER") GRAPH_DEF_VERSION_MIN_PRODUCER = ( pywrap_tensorflow.GRAPH_DEF_VERSION_MIN_PRODUCER) -tf_export("GRAPH_DEF_VERSION_MIN_PRODUCER").export_constant( - __name__, "GRAPH_DEF_VERSION_MIN_PRODUCER") +tf_export( + "version.GRAPH_DEF_VERSION_MIN_PRODUCER", + v1=[ + "version.GRAPH_DEF_VERSION_MIN_PRODUCER", + "GRAPH_DEF_VERSION_MIN_PRODUCER" + ]).export_constant(__name__, "GRAPH_DEF_VERSION_MIN_PRODUCER") __all__ = [ "__version__", diff --git a/tensorflow/python/saved_model/constants.py b/tensorflow/python/saved_model/constants.py index cb251f08bb5..0addbdc9686 100644 --- a/tensorflow/python/saved_model/constants.py +++ b/tensorflow/python/saved_model/constants.py @@ -23,23 +23,36 @@ from tensorflow.python.util.tf_export import tf_export # Subdirectory name containing the asset files. ASSETS_DIRECTORY = "assets" -tf_export("saved_model.constants.ASSETS_DIRECTORY").export_constant( - __name__, "ASSETS_DIRECTORY") +tf_export( + "saved_model.ASSETS_DIRECTORY", + v1=[ + "saved_model.ASSETS_DIRECTORY", "saved_model.constants.ASSETS_DIRECTORY" + ]).export_constant(__name__, "ASSETS_DIRECTORY") # CollectionDef key containing SavedModel assets. ASSETS_KEY = "saved_model_assets" -tf_export("saved_model.constants.ASSETS_KEY").export_constant( - __name__, "ASSETS_KEY") +tf_export( + "saved_model.ASSETS_KEY", + v1=["saved_model.ASSETS_KEY", + "saved_model.constants.ASSETS_KEY"]).export_constant( + __name__, "ASSETS_KEY") # CollectionDef key for the legacy init op. LEGACY_INIT_OP_KEY = "legacy_init_op" -tf_export("saved_model.constants.LEGACY_INIT_OP_KEY").export_constant( - __name__, "LEGACY_INIT_OP_KEY") +tf_export( + "saved_model.LEGACY_INIT_OP_KEY", + v1=[ + "saved_model.LEGACY_INIT_OP_KEY", + "saved_model.constants.LEGACY_INIT_OP_KEY" + ]).export_constant(__name__, "LEGACY_INIT_OP_KEY") # CollectionDef key for the SavedModel main op. MAIN_OP_KEY = "saved_model_main_op" -tf_export("saved_model.constants.MAIN_OP_KEY").export_constant( - __name__, "MAIN_OP_KEY") +tf_export( + "saved_model.MAIN_OP_KEY", + v1=["saved_model.MAIN_OP_KEY", + "saved_model.constants.MAIN_OP_KEY"]).export_constant( + __name__, "MAIN_OP_KEY") # CollectionDef key for the SavedModel train op. # Not exported while export_all_saved_models is in contrib. @@ -47,18 +60,30 @@ TRAIN_OP_KEY = "saved_model_train_op" # Schema version for SavedModel. SAVED_MODEL_SCHEMA_VERSION = 1 -tf_export("saved_model.constants.SAVED_MODEL_SCHEMA_VERSION").export_constant( - __name__, "SAVED_MODEL_SCHEMA_VERSION") +tf_export( + "saved_model.SAVED_MODEL_SCHEMA_VERSION", + v1=[ + "saved_model.SAVED_MODEL_SCHEMA_VERSION", + "saved_model.constants.SAVED_MODEL_SCHEMA_VERSION" + ]).export_constant(__name__, "SAVED_MODEL_SCHEMA_VERSION") # File name for SavedModel protocol buffer. SAVED_MODEL_FILENAME_PB = "saved_model.pb" -tf_export("saved_model.constants.SAVED_MODEL_FILENAME_PB").export_constant( - __name__, "SAVED_MODEL_FILENAME_PB") +tf_export( + "saved_model.SAVED_MODEL_FILENAME_PB", + v1=[ + "saved_model.SAVED_MODEL_FILENAME_PB", + "saved_model.constants.SAVED_MODEL_FILENAME_PB" + ]).export_constant(__name__, "SAVED_MODEL_FILENAME_PB") # File name for text version of SavedModel protocol buffer. SAVED_MODEL_FILENAME_PBTXT = "saved_model.pbtxt" -tf_export("saved_model.constants.SAVED_MODEL_FILENAME_PBTXT").export_constant( - __name__, "SAVED_MODEL_FILENAME_PBTXT") +tf_export( + "saved_model.SAVED_MODEL_FILENAME_PBTXT", + v1=[ + "saved_model.SAVED_MODEL_FILENAME_PBTXT", + "saved_model.constants.SAVED_MODEL_FILENAME_PBTXT" + ]).export_constant(__name__, "SAVED_MODEL_FILENAME_PBTXT") # File name for json format of SavedModel. # Not exported while keras_saved_model is in contrib. @@ -66,10 +91,18 @@ SAVED_MODEL_FILENAME_JSON = "saved_model.json" # Subdirectory name containing the variables/checkpoint files. VARIABLES_DIRECTORY = "variables" -tf_export("saved_model.constants.VARIABLES_DIRECTORY").export_constant( - __name__, "VARIABLES_DIRECTORY") +tf_export( + "saved_model.VARIABLES_DIRECTORY", + v1=[ + "saved_model.VARIABLES_DIRECTORY", + "saved_model.constants.VARIABLES_DIRECTORY" + ]).export_constant(__name__, "VARIABLES_DIRECTORY") # File name used for variables. VARIABLES_FILENAME = "variables" -tf_export("saved_model.constants.VARIABLES_FILENAME").export_constant( - __name__, "VARIABLES_FILENAME") +tf_export( + "saved_model.VARIABLES_FILENAME", + v1=[ + "saved_model.VARIABLES_FILENAME", + "saved_model.constants.VARIABLES_FILENAME" + ]).export_constant(__name__, "VARIABLES_FILENAME") diff --git a/tensorflow/python/saved_model/signature_constants.py b/tensorflow/python/saved_model/signature_constants.py index 99007a9634b..96460717ec5 100644 --- a/tensorflow/python/saved_model/signature_constants.py +++ b/tensorflow/python/saved_model/signature_constants.py @@ -26,72 +26,112 @@ from tensorflow.python.util.tf_export import tf_export # signature is used in inference requests where a specific signature was not # specified. DEFAULT_SERVING_SIGNATURE_DEF_KEY = "serving_default" -tf_export("saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY" - ).export_constant(__name__, "DEFAULT_SERVING_SIGNATURE_DEF_KEY") +tf_export( + "saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY", + v1=[ + "saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY", + "saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY" + ], +).export_constant(__name__, "DEFAULT_SERVING_SIGNATURE_DEF_KEY") ################################################################################ # Classification API constants. # Classification inputs. CLASSIFY_INPUTS = "inputs" -tf_export("saved_model.signature_constants.CLASSIFY_INPUTS").export_constant( - __name__, "CLASSIFY_INPUTS") +tf_export( + "saved_model.CLASSIFY_INPUTS", + v1=[ + "saved_model.CLASSIFY_INPUTS", + "saved_model.signature_constants.CLASSIFY_INPUTS" + ]).export_constant(__name__, "CLASSIFY_INPUTS") # Classification method name used in a SignatureDef. CLASSIFY_METHOD_NAME = "tensorflow/serving/classify" tf_export( - "saved_model.signature_constants.CLASSIFY_METHOD_NAME").export_constant( - __name__, "CLASSIFY_METHOD_NAME") + "saved_model.CLASSIFY_METHOD_NAME", + v1=[ + "saved_model.CLASSIFY_METHOD_NAME", + "saved_model.signature_constants.CLASSIFY_METHOD_NAME" + ]).export_constant(__name__, "CLASSIFY_METHOD_NAME") # Classification classes output. CLASSIFY_OUTPUT_CLASSES = "classes" tf_export( - "saved_model.signature_constants.CLASSIFY_OUTPUT_CLASSES").export_constant( - __name__, "CLASSIFY_OUTPUT_CLASSES") + "saved_model.CLASSIFY_OUTPUT_CLASSES", + v1=[ + "saved_model.CLASSIFY_OUTPUT_CLASSES", + "saved_model.signature_constants.CLASSIFY_OUTPUT_CLASSES" + ]).export_constant(__name__, "CLASSIFY_OUTPUT_CLASSES") # Classification scores output. CLASSIFY_OUTPUT_SCORES = "scores" tf_export( - "saved_model.signature_constants.CLASSIFY_OUTPUT_SCORES").export_constant( - __name__, "CLASSIFY_OUTPUT_SCORES") + "saved_model.CLASSIFY_OUTPUT_SCORES", + v1=[ + "saved_model.CLASSIFY_OUTPUT_SCORES", + "saved_model.signature_constants.CLASSIFY_OUTPUT_SCORES" + ]).export_constant(__name__, "CLASSIFY_OUTPUT_SCORES") ################################################################################ # Prediction API constants. # Predict inputs. PREDICT_INPUTS = "inputs" -tf_export("saved_model.signature_constants.PREDICT_INPUTS").export_constant( - __name__, "PREDICT_INPUTS") +tf_export( + "saved_model.PREDICT_INPUTS", + v1=[ + "saved_model.PREDICT_INPUTS", + "saved_model.signature_constants.PREDICT_INPUTS" + ]).export_constant(__name__, "PREDICT_INPUTS") # Prediction method name used in a SignatureDef. PREDICT_METHOD_NAME = "tensorflow/serving/predict" tf_export( - "saved_model.signature_constants.PREDICT_METHOD_NAME").export_constant( - __name__, "PREDICT_METHOD_NAME") + "saved_model.PREDICT_METHOD_NAME", + v1=[ + "saved_model.PREDICT_METHOD_NAME", + "saved_model.signature_constants.PREDICT_METHOD_NAME" + ]).export_constant(__name__, "PREDICT_METHOD_NAME") # Predict outputs. PREDICT_OUTPUTS = "outputs" -tf_export("saved_model.signature_constants.PREDICT_OUTPUTS").export_constant( - __name__, "PREDICT_OUTPUTS") +tf_export( + "saved_model.PREDICT_OUTPUTS", + v1=[ + "saved_model.PREDICT_OUTPUTS", + "saved_model.signature_constants.PREDICT_OUTPUTS" + ]).export_constant(__name__, "PREDICT_OUTPUTS") ################################################################################ # Regression API constants. # Regression inputs. REGRESS_INPUTS = "inputs" -tf_export("saved_model.signature_constants.REGRESS_INPUTS").export_constant( - __name__, "REGRESS_INPUTS") +tf_export( + "saved_model.REGRESS_INPUTS", + v1=[ + "saved_model.REGRESS_INPUTS", + "saved_model.signature_constants.REGRESS_INPUTS" + ]).export_constant(__name__, "REGRESS_INPUTS") # Regression method name used in a SignatureDef. REGRESS_METHOD_NAME = "tensorflow/serving/regress" tf_export( - "saved_model.signature_constants.REGRESS_METHOD_NAME").export_constant( - __name__, "REGRESS_METHOD_NAME") + "saved_model.REGRESS_METHOD_NAME", + v1=[ + "saved_model.REGRESS_METHOD_NAME", + "saved_model.signature_constants.REGRESS_METHOD_NAME" + ]).export_constant(__name__, "REGRESS_METHOD_NAME") # Regression outputs. REGRESS_OUTPUTS = "outputs" -tf_export("saved_model.signature_constants.REGRESS_OUTPUTS").export_constant( - __name__, "REGRESS_OUTPUTS") +tf_export( + "saved_model.REGRESS_OUTPUTS", + v1=[ + "saved_model.REGRESS_OUTPUTS", + "saved_model.signature_constants.REGRESS_OUTPUTS" + ]).export_constant(__name__, "REGRESS_OUTPUTS") ################################################################################ # Train/Eval API constants. diff --git a/tensorflow/python/saved_model/tag_constants.py b/tensorflow/python/saved_model/tag_constants.py index c82154e7b93..8c84c9fbe4d 100644 --- a/tensorflow/python/saved_model/tag_constants.py +++ b/tensorflow/python/saved_model/tag_constants.py @@ -24,23 +24,33 @@ from tensorflow.python.util.tf_export import tf_export # Tag for the `serving` graph. SERVING = "serve" -tf_export("saved_model.tag_constants.SERVING").export_constant( - __name__, "SERVING") +tf_export( + "saved_model.SERVING", + v1=["saved_model.SERVING", + "saved_model.tag_constants.SERVING"]).export_constant( + __name__, "SERVING") # Tag for the `training` graph. TRAINING = "train" -tf_export("saved_model.tag_constants.TRAINING").export_constant( - __name__, "TRAINING") +tf_export( + "saved_model.TRANING", + v1=["saved_model.TRAINING", + "saved_model.tag_constants.TRAINING"]).export_constant( + __name__, "TRAINING") # Tag for the `eval` graph. Not exported while the export logic is in contrib. EVAL = "eval" # Tag for the `gpu` graph. GPU = "gpu" -tf_export("saved_model.tag_constants.GPU").export_constant(__name__, "GPU") +tf_export( + "saved_model.GPU", v1=["saved_model.GPU", + "saved_model.tag_constants.GPU"]).export_constant( + __name__, "GPU") # Tag for the `tpu` graph. TPU = "tpu" -tf_export("saved_model.tag_constants.TPU").export_constant(__name__, "TPU") - - +tf_export( + "saved_model.TPU", v1=["saved_model.TPU", + "saved_model.tag_constants.TPU"]).export_constant( + __name__, "TPU") diff --git a/tensorflow/python/tools/api/generator/api_init_files.bzl b/tensorflow/python/tools/api/generator/api_init_files.bzl index dcf33f056be..1f5e6fd2b56 100644 --- a/tensorflow/python/tools/api/generator/api_init_files.bzl +++ b/tensorflow/python/tools/api/generator/api_init_files.bzl @@ -73,9 +73,6 @@ TENSORFLOW_API_INIT_FILES = [ "resource_loader/__init__.py", "strings/__init__.py", "saved_model/__init__.py", - "saved_model/constants/__init__.py", - "saved_model/signature_constants/__init__.py", - "saved_model/tag_constants/__init__.py", "sets/__init__.py", "sparse/__init__.py", "spectral/__init__.py", @@ -84,5 +81,6 @@ TENSORFLOW_API_INIT_FILES = [ "test/__init__.py", "train/__init__.py", "user_ops/__init__.py", + "version/__init__.py", # END GENERATED FILES ] diff --git a/tensorflow/python/tools/api/generator/api_init_files_v1.bzl b/tensorflow/python/tools/api/generator/api_init_files_v1.bzl index 0747424eabb..7a8660fd90b 100644 --- a/tensorflow/python/tools/api/generator/api_init_files_v1.bzl +++ b/tensorflow/python/tools/api/generator/api_init_files_v1.bzl @@ -91,5 +91,6 @@ TENSORFLOW_API_INIT_FILES_V1 = [ "train/__init__.py", "train/queue_runner/__init__.py", "user_ops/__init__.py", + "version/__init__.py", # END GENERATED FILES ] diff --git a/tensorflow/tools/api/golden/v1/tensorflow.dtypes.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.dtypes.pbtxt index ea23feca848..848fc303aa5 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.dtypes.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.dtypes.pbtxt @@ -4,6 +4,106 @@ tf_module { name: "DType" mtype: "" } + member { + name: "QUANTIZED_DTYPES" + mtype: "" + } + member { + name: "bfloat16" + mtype: "" + } + member { + name: "bool" + mtype: "" + } + member { + name: "complex128" + mtype: "" + } + member { + name: "complex64" + mtype: "" + } + member { + name: "double" + mtype: "" + } + member { + name: "float16" + mtype: "" + } + member { + name: "float32" + mtype: "" + } + member { + name: "float64" + mtype: "" + } + member { + name: "half" + mtype: "" + } + member { + name: "int32" + mtype: "" + } + member { + name: "int64" + mtype: "" + } + member { + name: "int8" + mtype: "" + } + member { + name: "qint16" + mtype: "" + } + member { + name: "qint32" + mtype: "" + } + member { + name: "qint8" + mtype: "" + } + member { + name: "quint16" + mtype: "" + } + member { + name: "quint8" + mtype: "" + } + member { + name: "resource" + mtype: "" + } + member { + name: "string" + mtype: "" + } + member { + name: "uint16" + mtype: "" + } + member { + name: "uint32" + mtype: "" + } + member { + name: "uint64" + mtype: "" + } + member { + name: "uint8" + mtype: "" + } + member { + name: "variant" + mtype: "" + } member_method { name: "as_dtype" argspec: "args=[\'type_value\'], varargs=None, keywords=None, defaults=None" diff --git a/tensorflow/tools/api/golden/v1/tensorflow.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.pbtxt index 247dfcc1cac..4502a3919c1 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.pbtxt @@ -600,6 +600,10 @@ tf_module { name: "variant" mtype: "" } + member { + name: "version" + mtype: "" + } member { name: "zeros_initializer" mtype: "" diff --git a/tensorflow/tools/api/golden/v1/tensorflow.saved_model.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.saved_model.pbtxt index 3f4965fc691..5b28f7b9b18 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.saved_model.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.saved_model.pbtxt @@ -1,9 +1,105 @@ path: "tensorflow.saved_model" tf_module { + member { + name: "ASSETS_DIRECTORY" + mtype: "" + } + member { + name: "ASSETS_KEY" + mtype: "" + } member { name: "Builder" mtype: "" } + member { + name: "CLASSIFY_INPUTS" + mtype: "" + } + member { + name: "CLASSIFY_METHOD_NAME" + mtype: "" + } + member { + name: "CLASSIFY_OUTPUT_CLASSES" + mtype: "" + } + member { + name: "CLASSIFY_OUTPUT_SCORES" + mtype: "" + } + member { + name: "DEFAULT_SERVING_SIGNATURE_DEF_KEY" + mtype: "" + } + member { + name: "GPU" + mtype: "" + } + member { + name: "LEGACY_INIT_OP_KEY" + mtype: "" + } + member { + name: "MAIN_OP_KEY" + mtype: "" + } + member { + name: "PREDICT_INPUTS" + mtype: "" + } + member { + name: "PREDICT_METHOD_NAME" + mtype: "" + } + member { + name: "PREDICT_OUTPUTS" + mtype: "" + } + member { + name: "REGRESS_INPUTS" + mtype: "" + } + member { + name: "REGRESS_METHOD_NAME" + mtype: "" + } + member { + name: "REGRESS_OUTPUTS" + mtype: "" + } + member { + name: "SAVED_MODEL_FILENAME_PB" + mtype: "" + } + member { + name: "SAVED_MODEL_FILENAME_PBTXT" + mtype: "" + } + member { + name: "SAVED_MODEL_SCHEMA_VERSION" + mtype: "" + } + member { + name: "SERVING" + mtype: "" + } + member { + name: "TPU" + mtype: "" + } + member { + name: "TRAINING" + mtype: "" + } + member { + name: "VARIABLES_DIRECTORY" + mtype: "" + } + member { + name: "VARIABLES_FILENAME" + mtype: "" + } member { name: "builder" mtype: "" diff --git a/tensorflow/tools/api/golden/v1/tensorflow.sysconfig.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.sysconfig.pbtxt index 2f00aeac25f..811ca18cdb4 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.sysconfig.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.sysconfig.pbtxt @@ -1,5 +1,13 @@ path: "tensorflow.sysconfig" tf_module { + member { + name: "CXX11_ABI_FLAG" + mtype: "" + } + member { + name: "MONOLITHIC_BUILD" + mtype: "" + } member_method { name: "get_compile_flags" argspec: "args=[], varargs=None, keywords=None, defaults=None" diff --git a/tensorflow/tools/api/golden/v1/tensorflow.version.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.version.pbtxt new file mode 100644 index 00000000000..dd4506cb0b3 --- /dev/null +++ b/tensorflow/tools/api/golden/v1/tensorflow.version.pbtxt @@ -0,0 +1,27 @@ +path: "tensorflow.version" +tf_module { + member { + name: "COMPILER_VERSION" + mtype: "" + } + member { + name: "GIT_VERSION" + mtype: "" + } + member { + name: "GRAPH_DEF_VERSION" + mtype: "" + } + member { + name: "GRAPH_DEF_VERSION_MIN_CONSUMER" + mtype: "" + } + member { + name: "GRAPH_DEF_VERSION_MIN_PRODUCER" + mtype: "" + } + member { + name: "VERSION" + mtype: "" + } +} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.dtypes.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.dtypes.pbtxt index ea23feca848..848fc303aa5 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.dtypes.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.dtypes.pbtxt @@ -4,6 +4,106 @@ tf_module { name: "DType" mtype: "" } + member { + name: "QUANTIZED_DTYPES" + mtype: "" + } + member { + name: "bfloat16" + mtype: "" + } + member { + name: "bool" + mtype: "" + } + member { + name: "complex128" + mtype: "" + } + member { + name: "complex64" + mtype: "" + } + member { + name: "double" + mtype: "" + } + member { + name: "float16" + mtype: "" + } + member { + name: "float32" + mtype: "" + } + member { + name: "float64" + mtype: "" + } + member { + name: "half" + mtype: "" + } + member { + name: "int32" + mtype: "" + } + member { + name: "int64" + mtype: "" + } + member { + name: "int8" + mtype: "" + } + member { + name: "qint16" + mtype: "" + } + member { + name: "qint32" + mtype: "" + } + member { + name: "qint8" + mtype: "" + } + member { + name: "quint16" + mtype: "" + } + member { + name: "quint8" + mtype: "" + } + member { + name: "resource" + mtype: "" + } + member { + name: "string" + mtype: "" + } + member { + name: "uint16" + mtype: "" + } + member { + name: "uint32" + mtype: "" + } + member { + name: "uint64" + mtype: "" + } + member { + name: "uint8" + mtype: "" + } + member { + name: "variant" + mtype: "" + } member_method { name: "as_dtype" argspec: "args=[\'type_value\'], varargs=None, keywords=None, defaults=None" diff --git a/tensorflow/tools/api/golden/v2/tensorflow.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.pbtxt index 37e8e654b70..3664eef4063 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.pbtxt @@ -8,14 +8,6 @@ tf_module { name: "AttrValue" mtype: "" } - member { - name: "COMPILER_VERSION" - mtype: "" - } - member { - name: "CXX11_ABI_FLAG" - mtype: "" - } member { name: "ConditionalAccumulator" mtype: "" @@ -56,26 +48,10 @@ tf_module { name: "FixedLenSequenceFeature" mtype: "" } - member { - name: "GIT_VERSION" - mtype: "" - } member { name: "GPUOptions" mtype: "" } - member { - name: "GRAPH_DEF_VERSION" - mtype: "" - } - member { - name: "GRAPH_DEF_VERSION_MIN_CONSUMER" - mtype: "" - } - member { - name: "GRAPH_DEF_VERSION_MIN_PRODUCER" - mtype: "" - } member { name: "GradientTape" mtype: "" @@ -112,10 +88,6 @@ tf_module { name: "LogMessage" mtype: "" } - member { - name: "MONOLITHIC_BUILD" - mtype: "" - } member { name: "MetaGraphDef" mtype: "" @@ -200,10 +172,6 @@ tf_module { name: "UnconnectedGradients" mtype: "" } - member { - name: "VERSION" - mtype: "" - } member { name: "VarLenFeature" mtype: "" @@ -512,6 +480,10 @@ tf_module { name: "variant" mtype: "" } + member { + name: "version" + mtype: "" + } member { name: "zeros_initializer" mtype: "" diff --git a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.constants.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.saved_model.constants.pbtxt deleted file mode 100644 index 20e10aa094f..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.constants.pbtxt +++ /dev/null @@ -1,39 +0,0 @@ -path: "tensorflow.saved_model.constants" -tf_module { - member { - name: "ASSETS_DIRECTORY" - mtype: "" - } - member { - name: "ASSETS_KEY" - mtype: "" - } - member { - name: "LEGACY_INIT_OP_KEY" - mtype: "" - } - member { - name: "MAIN_OP_KEY" - mtype: "" - } - member { - name: "SAVED_MODEL_FILENAME_PB" - mtype: "" - } - member { - name: "SAVED_MODEL_FILENAME_PBTXT" - mtype: "" - } - member { - name: "SAVED_MODEL_SCHEMA_VERSION" - mtype: "" - } - member { - name: "VARIABLES_DIRECTORY" - mtype: "" - } - member { - name: "VARIABLES_FILENAME" - mtype: "" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.saved_model.pbtxt index a95ab4a3bc0..dc26a67fa0e 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.saved_model.pbtxt @@ -1,20 +1,104 @@ path: "tensorflow.saved_model" tf_module { + member { + name: "ASSETS_DIRECTORY" + mtype: "" + } + member { + name: "ASSETS_KEY" + mtype: "" + } member { name: "Builder" mtype: "" } member { - name: "constants" - mtype: "" + name: "CLASSIFY_INPUTS" + mtype: "" } member { - name: "signature_constants" - mtype: "" + name: "CLASSIFY_METHOD_NAME" + mtype: "" } member { - name: "tag_constants" - mtype: "" + name: "CLASSIFY_OUTPUT_CLASSES" + mtype: "" + } + member { + name: "CLASSIFY_OUTPUT_SCORES" + mtype: "" + } + member { + name: "DEFAULT_SERVING_SIGNATURE_DEF_KEY" + mtype: "" + } + member { + name: "GPU" + mtype: "" + } + member { + name: "LEGACY_INIT_OP_KEY" + mtype: "" + } + member { + name: "MAIN_OP_KEY" + mtype: "" + } + member { + name: "PREDICT_INPUTS" + mtype: "" + } + member { + name: "PREDICT_METHOD_NAME" + mtype: "" + } + member { + name: "PREDICT_OUTPUTS" + mtype: "" + } + member { + name: "REGRESS_INPUTS" + mtype: "" + } + member { + name: "REGRESS_METHOD_NAME" + mtype: "" + } + member { + name: "REGRESS_OUTPUTS" + mtype: "" + } + member { + name: "SAVED_MODEL_FILENAME_PB" + mtype: "" + } + member { + name: "SAVED_MODEL_FILENAME_PBTXT" + mtype: "" + } + member { + name: "SAVED_MODEL_SCHEMA_VERSION" + mtype: "" + } + member { + name: "SERVING" + mtype: "" + } + member { + name: "TPU" + mtype: "" + } + member { + name: "TRANING" + mtype: "" + } + member { + name: "VARIABLES_DIRECTORY" + mtype: "" + } + member { + name: "VARIABLES_FILENAME" + mtype: "" } member_method { name: "build_signature_def" diff --git a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.signature_constants.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.saved_model.signature_constants.pbtxt deleted file mode 100644 index 478d410e066..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.signature_constants.pbtxt +++ /dev/null @@ -1,47 +0,0 @@ -path: "tensorflow.saved_model.signature_constants" -tf_module { - member { - name: "CLASSIFY_INPUTS" - mtype: "" - } - member { - name: "CLASSIFY_METHOD_NAME" - mtype: "" - } - member { - name: "CLASSIFY_OUTPUT_CLASSES" - mtype: "" - } - member { - name: "CLASSIFY_OUTPUT_SCORES" - mtype: "" - } - member { - name: "DEFAULT_SERVING_SIGNATURE_DEF_KEY" - mtype: "" - } - member { - name: "PREDICT_INPUTS" - mtype: "" - } - member { - name: "PREDICT_METHOD_NAME" - mtype: "" - } - member { - name: "PREDICT_OUTPUTS" - mtype: "" - } - member { - name: "REGRESS_INPUTS" - mtype: "" - } - member { - name: "REGRESS_METHOD_NAME" - mtype: "" - } - member { - name: "REGRESS_OUTPUTS" - mtype: "" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.tag_constants.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.saved_model.tag_constants.pbtxt deleted file mode 100644 index 6af72498d74..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.saved_model.tag_constants.pbtxt +++ /dev/null @@ -1,19 +0,0 @@ -path: "tensorflow.saved_model.tag_constants" -tf_module { - member { - name: "GPU" - mtype: "" - } - member { - name: "SERVING" - mtype: "" - } - member { - name: "TPU" - mtype: "" - } - member { - name: "TRAINING" - mtype: "" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.sysconfig.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.sysconfig.pbtxt index 2f00aeac25f..811ca18cdb4 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.sysconfig.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.sysconfig.pbtxt @@ -1,5 +1,13 @@ path: "tensorflow.sysconfig" tf_module { + member { + name: "CXX11_ABI_FLAG" + mtype: "" + } + member { + name: "MONOLITHIC_BUILD" + mtype: "" + } member_method { name: "get_compile_flags" argspec: "args=[], varargs=None, keywords=None, defaults=None" diff --git a/tensorflow/tools/api/golden/v2/tensorflow.version.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.version.pbtxt new file mode 100644 index 00000000000..dd4506cb0b3 --- /dev/null +++ b/tensorflow/tools/api/golden/v2/tensorflow.version.pbtxt @@ -0,0 +1,27 @@ +path: "tensorflow.version" +tf_module { + member { + name: "COMPILER_VERSION" + mtype: "" + } + member { + name: "GIT_VERSION" + mtype: "" + } + member { + name: "GRAPH_DEF_VERSION" + mtype: "" + } + member { + name: "GRAPH_DEF_VERSION_MIN_CONSUMER" + mtype: "" + } + member { + name: "GRAPH_DEF_VERSION_MIN_PRODUCER" + mtype: "" + } + member { + name: "VERSION" + mtype: "" + } +}