aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc
diff options
context:
space:
mode:
authorGravatar James Qin <jamesqin@google.com>2018-01-05 14:55:24 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-05 14:58:51 -0800
commitcc94f3888eb008fd78a2d95e30ecf76fbce0e0af (patch)
treecc126be226c801b8fc374b5ff4050deace0c098d /tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc
parentc152d4bbac33d9dc10f7278226aaeb42fce799b5 (diff)
Automated g4 rollback of changelist 180848930
PiperOrigin-RevId: 180979141
Diffstat (limited to 'tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc')
-rw-r--r--tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc b/tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc
index 3a8d591236..d84b69d06b 100644
--- a/tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc
+++ b/tensorflow/core/distributed_runtime/cluster_function_library_runtime.cc
@@ -26,10 +26,10 @@ namespace tensorflow {
/* static */
Status ClusterFunctionLibraryRuntime::ConstructFunctionGraph(
- const OpDef& sig, AttrSlice attrs,
- const FunctionLibraryRuntime::InstantiateOptions& options, GraphDef* g,
+ const OpDef& sig, AttrSlice attrs, GraphDef* g,
std::vector<string>* send_keys, std::vector<string>* recv_keys) {
- const string& target = options.target;
+ const string& target =
+ ProcessFunctionLibraryRuntime::ObtainFunctionTarget(attrs);
// Construct recv nodes for each input argument.
int i = 0;
for (const auto& in : sig.input_arg()) {
@@ -119,16 +119,16 @@ ClusterFunctionLibraryRuntime::~ClusterFunctionLibraryRuntime() {
Status ClusterFunctionLibraryRuntime::Instantiate(
const string& function_name, const FunctionLibraryDefinition& lib_def,
- AttrSlice attrs, const FunctionLibraryRuntime::InstantiateOptions& options,
- FunctionLibraryRuntime::LocalHandle* handle) {
- WorkerInterface* wi =
- worker_session_->worker_cache->CreateWorker(options.target);
+ AttrSlice attrs, FunctionLibraryRuntime::LocalHandle* handle) {
+ const string& target =
+ ProcessFunctionLibraryRuntime::ObtainFunctionTarget(attrs);
+ WorkerInterface* wi = worker_session_->worker_cache->CreateWorker(target);
if (wi == nullptr) {
std::vector<string> workers;
worker_session_->worker_cache->ListWorkers(&workers);
return errors::InvalidArgument(
- "Could not find worker with target: ", options.target,
+ "Could not find worker with target: ", target,
" Available workers: ", str_util::Join(workers, ", "));
}
@@ -137,8 +137,8 @@ Status ClusterFunctionLibraryRuntime::Instantiate(
const OpDef& sig = fdef->signature();
GraphDef gdef;
std::vector<string> send_keys, recv_keys;
- TF_RETURN_IF_ERROR(ConstructFunctionGraph(sig, attrs, options, &gdef,
- &send_keys, &recv_keys));
+ TF_RETURN_IF_ERROR(
+ ConstructFunctionGraph(sig, attrs, &gdef, &send_keys, &recv_keys));
*gdef.mutable_library() = lib_def.ToProto();
RegisterGraphRequest req;
@@ -152,8 +152,8 @@ Status ClusterFunctionLibraryRuntime::Instantiate(
mutex_lock l(mu_);
*handle = function_data_.size();
- function_data_.push_back(FunctionData(resp.graph_handle(), options.target, wi,
- send_keys, recv_keys));
+ function_data_.push_back(
+ FunctionData(resp.graph_handle(), target, wi, send_keys, recv_keys));
return Status::OK();
}