1 /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License");; 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #include "pybind11/pybind11.h" 17 #include "tensorflow/cc/saved_model/constants.h" 18 19 namespace tensorflow { 20 namespace saved_model { 21 namespace python { 22 23 namespace py = pybind11; 24 DefineConstantsModule(py::module main_module)25void DefineConstantsModule(py::module main_module) { 26 auto m = main_module.def_submodule("constants"); 27 28 m.doc() = "Python bindings for TensorFlow SavedModel Constants"; 29 30 m.attr("ASSETS_DIRECTORY") = py::str(tensorflow::kSavedModelAssetsDirectory); 31 32 m.attr("EXTRA_ASSETS_DIRECTORY") = 33 py::str(tensorflow::kSavedModelAssetsExtraDirectory); 34 35 m.attr("ASSETS_KEY") = py::str(tensorflow::kSavedModelAssetsKey); 36 37 m.attr("DEBUG_DIRECTORY") = py::str(tensorflow::kSavedModelDebugDirectory); 38 39 m.attr("DEBUG_INFO_FILENAME_PB") = 40 py::str(tensorflow::kSavedModelDebugInfoFilenamePb); 41 42 m.attr("INIT_OP_SIGNATURE_KEY") = 43 py::str(tensorflow::kSavedModelInitOpSignatureKey); 44 45 m.attr("LEGACY_INIT_OP_KEY") = 46 py::str(tensorflow::kSavedModelLegacyInitOpKey); 47 48 m.attr("MAIN_OP_KEY") = py::str(tensorflow::kSavedModelMainOpKey); 49 50 m.attr("TRAIN_OP_KEY") = py::str(tensorflow::kSavedModelTrainOpKey); 51 52 m.attr("TRAIN_OP_SIGNATURE_KEY") = 53 py::str(tensorflow::kSavedModelTrainOpSignatureKey); 54 55 m.attr("SAVED_MODEL_FILENAME_PB") = 56 py::str(tensorflow::kSavedModelFilenamePb); 57 58 m.attr("SAVED_MODEL_FILENAME_PBTXT") = 59 py::str(tensorflow::kSavedModelFilenamePbTxt); 60 61 m.attr("SAVED_MODEL_SCHEMA_VERSION") = tensorflow::kSavedModelSchemaVersion; 62 63 m.attr("VARIABLES_DIRECTORY") = 64 py::str(tensorflow::kSavedModelVariablesDirectory); 65 66 m.attr("VARIABLES_FILENAME") = 67 py::str(tensorflow::kSavedModelVariablesFilename); 68 69 m.attr("FINGERPRINT_FILENAME") = py::str(tensorflow::kFingerprintFilenamePb); 70 } 71 72 } // namespace python 73 } // namespace saved_model 74 } // namespace tensorflow 75