aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/common_runtime/function_test.cc
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2018-01-04 14:48:09 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-04 14:51:51 -0800
commit19bbc31eee8b81bce6eb08b7ada539943fac6014 (patch)
tree079f8dcc4b87783f3c356011e5708e11a33814d4 /tensorflow/core/common_runtime/function_test.cc
parentb639608a6da140f720636582022a575d7c8a7650 (diff)
Add `FunctionLibraryRuntime::InstantiateOptions` struct.
This new struct allows optional arguments to be passed to the `FunctionLibraryRuntime::Instantiate()` API. The new struct is now used to configure the target device for a function instantiation (instead of an attr). PiperOrigin-RevId: 180848930
Diffstat (limited to 'tensorflow/core/common_runtime/function_test.cc')
-rw-r--r--tensorflow/core/common_runtime/function_test.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/tensorflow/core/common_runtime/function_test.cc b/tensorflow/core/common_runtime/function_test.cc
index d4181ff48c..2dacacea7b 100644
--- a/tensorflow/core/common_runtime/function_test.cc
+++ b/tensorflow/core/common_runtime/function_test.cc
@@ -191,11 +191,14 @@ class FunctionLibraryRuntimeTest : public ::testing::Test {
Status Instantiate(FunctionLibraryRuntime* flr, const string& name,
test::function::Attrs attrs,
FunctionLibraryRuntime::Handle* handle) {
- Status status = flr->Instantiate(name, attrs, handle);
- if (!status.ok()) {
- return status;
- }
- return Status::OK();
+ return flr->Instantiate(name, attrs, handle);
+ }
+
+ Status Instantiate(FunctionLibraryRuntime* flr, const string& name,
+ test::function::Attrs attrs,
+ const FunctionLibraryRuntime::InstantiateOptions& options,
+ FunctionLibraryRuntime::Handle* handle) {
+ return flr->Instantiate(name, attrs, options, handle);
}
Status InstantiateAndRun(FunctionLibraryRuntime* flr, const string& name,
@@ -1088,8 +1091,7 @@ TEST_F(FunctionLibraryRuntimeTest, Gradient_AddSum) {
TEST_F(FunctionLibraryRuntimeTest, CrossDevice) {
Init({test::function::FindDevice()});
FunctionLibraryRuntime::Handle handle;
- TF_CHECK_OK(Instantiate(flr0_, "FindDevice", {{"_target", "/device:CPU:1"}},
- &handle));
+ TF_CHECK_OK(Instantiate(flr0_, "FindDevice", {}, {"/device:CPU:1"}, &handle));
Tensor y;
FunctionLibraryRuntime::Options opts;