16 #ifndef TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_SERVING_SESSION_H_
17 #define TENSORFLOW_SERVING_SERVABLES_TENSORFLOW_SERVING_SESSION_H_
24 #include "tensorflow/core/platform/logging.h"
25 #include "tensorflow/core/platform/threadpool_options.h"
26 #include "tensorflow/core/public/session.h"
28 namespace tensorflow {
40 Status Create(
const GraphDef& graph)
final;
41 Status Extend(
const GraphDef& graph)
final;
52 : wrapped_(std::move(wrapped)) {
53 VLOG(2) <<
"Created the ServingSessionWrapper around the Session.";
58 Status Run(
const std::vector<std::pair<string, Tensor>>& inputs,
59 const std::vector<string>& output_tensor_names,
60 const std::vector<string>& target_node_names,
61 std::vector<Tensor>* outputs)
override {
62 return wrapped_->Run(inputs, output_tensor_names, target_node_names,
66 Status Run(
const RunOptions& run_options,
67 const std::vector<std::pair<string, Tensor>>& inputs,
68 const std::vector<string>& output_tensor_names,
69 const std::vector<string>& target_node_names,
70 std::vector<Tensor>* outputs, RunMetadata* run_metadata)
override {
71 return wrapped_->Run(run_options, inputs, output_tensor_names,
72 target_node_names, outputs, run_metadata);
75 Status Run(
const RunOptions& run_options,
76 const std::vector<std::pair<string, Tensor>>& inputs,
77 const std::vector<string>& output_tensor_names,
78 const std::vector<string>& target_node_names,
79 std::vector<Tensor>* outputs, RunMetadata* run_metadata,
80 const thread::ThreadPoolOptions& thread_pool_options)
override {
81 return wrapped_->Run(run_options, inputs, output_tensor_names,
82 target_node_names, outputs, run_metadata,
86 Status ListDevices(std::vector<DeviceAttributes>* response)
override {
87 return wrapped_->ListDevices(response);
91 std::unique_ptr<Session> wrapped_;
103 std::unique_ptr<Session> wrapped)
105 VLOG(2) <<
"Created the SessionWrapperIgnoreThreadPoolOptions around the "
109 Status Run(
const RunOptions& run_options,
110 const std::vector<std::pair<string, Tensor>>& inputs,
111 const std::vector<string>& output_tensor_names,
112 const std::vector<string>& target_node_names,
113 std::vector<Tensor>* outputs, RunMetadata* run_metadata,
114 const thread::ThreadPoolOptions& thread_pool_options)
override {
115 return ServingSessionWrapper::Run(run_options, inputs, output_tensor_names,
116 target_node_names, outputs, run_metadata);