TensorFlow Serving C++ API Documentation
tensorflow_serving
servables
tensorflow
predict_impl.h
1
/* Copyright 2016 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_PREDICT_IMPL_H_
17
#define TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_PREDICT_IMPL_H_
18
19
#include "tensorflow/core/framework/tensor.pb.h"
20
#include "tensorflow/core/lib/core/status.h"
21
#include "tensorflow/core/protobuf/config.pb.h"
22
#include "tensorflow_serving/apis/predict.pb.h"
23
#include "tensorflow_serving/model_servers/server_core.h"
24
#include "tensorflow_serving/servables/tensorflow/thread_pool_factory.h"
25
26
namespace
tensorflow {
27
namespace
serving {
28
29
// Utility methods for implementation of PredictionService::Predict.
30
class
TensorflowPredictor
{
31
public
:
32
TensorflowPredictor
() {}
33
34
explicit
TensorflowPredictor
(
ThreadPoolFactory
* thread_pool_factory)
35
: thread_pool_factory_(thread_pool_factory) {}
36
37
Status Predict(
const
RunOptions& run_options,
ServerCore
* core,
38
const
PredictRequest& request, PredictResponse* response);
39
40
// Like Predict(), but uses 'model_spec' instead of the one embedded in
41
// 'request'.
42
Status PredictWithModelSpec(
const
RunOptions& run_options,
ServerCore
* core,
43
const
ModelSpec& model_spec,
44
const
PredictRequest& request,
45
PredictResponse* response);
46
47
private
:
48
ThreadPoolFactory
* thread_pool_factory_ =
nullptr
;
49
};
50
51
}
// namespace serving
52
}
// namespace tensorflow
53
54
#endif
// TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_PREDICT_IMPL_H_
tensorflow::serving::ServerCore
Definition:
server_core.h:74
tensorflow::serving::TensorflowPredictor
Definition:
predict_impl.h:30
tensorflow::serving::ThreadPoolFactory
Definition:
thread_pool_factory.h:48
Generated by
1.9.1