TensorFlow Serving C++ API Documentation
version.h
1 /* Copyright 2018 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 #ifndef TENSORFLOW_SERVING_MODEL_SERVERS_VERSION_H_
17 #define TENSORFLOW_SERVING_MODEL_SERVERS_VERSION_H_
18 
19 // TF Serving Model Server uses semantic versioning for releases
20 // - see http://semver.org/. For nightlies, a git hash is used to track the
21 // build via linkstamping
22 #define TF_MODELSERVER_STR_HELPER(x) #x
23 #define TF_MODELSERVER_STR(x) TF_MODELSERVER_STR_HELPER(x)
24 
25 #define TF_MODELSERVER_MAJOR_VERSION 0
26 #define TF_MODELSERVER_MINOR_VERSION 0
27 #define TF_MODELSERVER_PATCH_VERSION 0
28 // TF_MODELSERVER_VERSION_SUFFIX is non-empty for pre-releases
29 // (e.g. "-alpha", "-alpha.1", "-beta", "-rc", "-rc.1")
30 #define TF_MODELSERVER_VERSION_SUFFIX ""
31 
32 #ifndef TF_MODELSERVER_VERSION_NO_META
33 // TF_MODELSERVER_BUILD_TAG can be set to be nightly for nightly builds
34 #ifndef TF_MODELSERVER_BUILD_TAG
35 #define TF_MODELSERVER_META_TAG "+dev"
36 #else
37 #define TF_MODELSERVER_META_TAG "+" TF_MODELSERVER_STR(TF_MODELSERVER_BUILD_TAG)
38 #endif
39 #define TF_MODELSERVER_META_SCM_HASH ".sha." BUILD_SCM_REVISION
40 #else
41 #define TF_MODELSERVER_META_TAG ""
42 #define TF_MODELSERVER_META_SCM_HASH ""
43 #endif
44 
45 // e.g. "0.5.0+nightly.sha.a1b2c3d" or "0.6.0-rc1".
46 // clang-format off
47 #define TF_MODELSERVER_VERSION_STRING \
48  (TF_MODELSERVER_STR(TF_MODELSERVER_MAJOR_VERSION) "." TF_MODELSERVER_STR( \
49  TF_MODELSERVER_MINOR_VERSION) "." TF_MODELSERVER_STR( \
50  TF_MODELSERVER_PATCH_VERSION) TF_MODELSERVER_VERSION_SUFFIX \
51  TF_MODELSERVER_META_TAG TF_MODELSERVER_META_SCM_HASH)
52 // clang-format on
53 
54 extern "C" {
55 const char* TF_Serving_Version();
56 }
57 
58 #endif // TENSORFLOW_SERVING_MODEL_SERVERS_VERSION_H_