From afcc1a4452de7898391683f7cbb16ff548f839a1 Mon Sep 17 00:00:00 2001 From: Derek Murray Date: Wed, 10 Oct 2018 08:17:09 -0700 Subject: Allow the executor type for a function to be specified as an attr on a function. This change complements the existing `InstantiateOptions::executor_type` option, which takes precedence over the attr if both are provided. It enables the choice of executor to be separated from both the calling op implementation and the function definition, which simplifies the use of custom executors in operations that take a function as an attr (e.g.) `tf.data` and the functional control-flow ops. PiperOrigin-RevId: 216532778 --- tensorflow/core/common_runtime/function.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tensorflow/core/common_runtime/function.cc') diff --git a/tensorflow/core/common_runtime/function.cc b/tensorflow/core/common_runtime/function.cc index 472865ca43..e0e5f4a215 100644 --- a/tensorflow/core/common_runtime/function.cc +++ b/tensorflow/core/common_runtime/function.cc @@ -551,7 +551,7 @@ Status FunctionLibraryRuntimeImpl::Instantiate( item->func_graph = fbody; item->overlay_lib = options.overlay_lib; item->instantiation_counter = 1; - item->executor_type = options.executor_type; + item->executor_type = ExecutorType(options, attrs); items_.emplace(next_handle_, std::unique_ptr(item)); next_handle_++; } -- cgit v1.2.3