18 #ifndef TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_REGRESSOR_H_
19 #define TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_REGRESSOR_H_
23 #include "absl/types/optional.h"
24 #include "tensorflow/cc/saved_model/loader.h"
25 #include "tensorflow/core/lib/core/status.h"
26 #include "tensorflow/core/platform/threadpool_options.h"
27 #include "tensorflow_serving/apis/regressor.h"
29 namespace tensorflow {
34 Status CreateRegressorFromSavedModelBundle(
35 const RunOptions& run_options, std::unique_ptr<SavedModelBundle> bundle,
36 std::unique_ptr<RegressorInterface>* service);
43 Status CreateFlyweightTensorFlowRegressor(
44 const RunOptions& run_options, Session* session,
45 const SignatureDef* signature,
46 std::unique_ptr<RegressorInterface>* service);
49 Status CreateFlyweightTensorFlowRegressor(
50 const RunOptions& run_options, Session* session,
51 const SignatureDef* signature,
52 const thread::ThreadPoolOptions& thread_pool_options,
53 std::unique_ptr<RegressorInterface>* service);
59 Status GetRegressionSignatureDef(
const ModelSpec& model_spec,
60 const MetaGraphDef& meta_graph_def,
61 SignatureDef* signature);
69 Status PreProcessRegression(
const SignatureDef& signature,
70 string* input_tensor_name,
71 std::vector<string>* output_tensor_names);
74 Status PostProcessRegressionResult(
75 const SignatureDef& signature,
int num_examples,
76 const std::vector<string>& output_tensor_names,
77 const std::vector<Tensor>& output_tensors, RegressionResult* result);
80 Status RunRegress(
const RunOptions& run_options,
81 const MetaGraphDef& meta_graph_def,
82 const absl::optional<int64_t>& servable_version,
83 Session* session,
const RegressionRequest& request,
84 RegressionResponse* response,
85 const thread::ThreadPoolOptions& thread_pool_options =
86 thread::ThreadPoolOptions());