aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/saved_model/constants.py
blob: cb251f08bb56fd5496ea4f3aaedfd2822ae1565c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Constants for SavedModel save and restore operations.

"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

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")

# CollectionDef key containing SavedModel assets.
ASSETS_KEY = "saved_model_assets"
tf_export("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")

# 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")

# CollectionDef key for the SavedModel train op.
# Not exported while export_all_saved_models is in contrib.
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")

# 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")

# 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")

# File name for json format of SavedModel.
# Not exported while keras_saved_model is in contrib.
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")

# File name used for variables.
VARIABLES_FILENAME = "variables"
tf_export("saved_model.constants.VARIABLES_FILENAME").export_constant(
    __name__, "VARIABLES_FILENAME")