TensorFlow Serving C++ API Documentation
tfrt_classification_service.h
1 /* Copyright 2020 Google Inc. 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_SERVABLES_TENSORFLOW_TFRT_CLASSIFICATION_SERVICE_H_
17 #define TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_TFRT_CLASSIFICATION_SERVICE_H_
18 
19 #include "tensorflow/core/lib/core/status.h"
20 #include "tensorflow/core/protobuf/config.pb.h"
21 #include "tensorflow_serving/apis/classification.pb.h"
22 #include "tensorflow_serving/model_servers/server_core.h"
23 #include "tensorflow_serving/servables/tensorflow/servable.h"
24 
25 namespace tensorflow {
26 namespace serving {
27 
28 // Utility methods for implementation of the Classify RPC in
29 // tensorflow_serving/apis/prediction_service.proto
31  public:
32  static Status Classify(const Servable::RunOptions& run_options,
33  ServerCore* core, const ClassificationRequest& request,
34  ClassificationResponse* response);
35 
36  // Like Classify(), but uses 'model_spec' instead of the one embedded in
37  // 'request'.
38  static Status ClassifyWithModelSpec(const Servable::RunOptions& run_options,
39  ServerCore* core,
40  const ModelSpec& model_spec,
41  const ClassificationRequest& request,
42  ClassificationResponse* response);
43 };
44 
45 } // namespace serving
46 } // namespace tensorflow
47 
48 #endif // TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_TFRT_CLASSIFICATION_SERVICE_H_