diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-11-21 10:01:57 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-11-21 10:05:24 -0800 |
commit | 745eb9242d3b3b8e860abce018c74444a02e0926 (patch) | |
tree | 799695fbd009616925a66202c5f7d7f37cc3d64d /tensorflow/core/debug | |
parent | 3def704f255c3af59fd3225dba862834e35b3493 (diff) |
Fix tests that prevent enabling the dependency optimizer in grappler.
- Most of these use constant inputs that cause the new optimizer to turn various backprop nodes into NoOps because their outputs are not consumed.
Improve or fix a few issues in the dependency optimizer:
- Prune duplicate control inputs. Don't add new control inputs if the target already has the source as a regular input.
- Don't turn Merge, Switch, Enter, Exit, NextIteration, _TPUExecute or _TPUCompile nodes into NoOps.
- Don't call ConstantFolding::AddControlDependency() when re-routing, since the nodes
in questions already have control inputs, so cannot be Switch nodes.
- Don't clear inputs from NoOps unless we know the fetch nodes.
PiperOrigin-RevId: 176523299
Diffstat (limited to 'tensorflow/core/debug')
-rw-r--r-- | tensorflow/core/debug/debug_gateway_test.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tensorflow/core/debug/debug_gateway_test.cc b/tensorflow/core/debug/debug_gateway_test.cc index 3903040e4d..5758334906 100644 --- a/tensorflow/core/debug/debug_gateway_test.cc +++ b/tensorflow/core/debug/debug_gateway_test.cc @@ -40,6 +40,9 @@ std::unique_ptr<DirectSession> CreateSession() { options.config.mutable_graph_options() ->mutable_rewrite_options() ->set_constant_folding(RewriterConfig::OFF); + options.config.mutable_graph_options() + ->mutable_rewrite_options() + ->set_dependency_optimization(RewriterConfig::OFF); return std::unique_ptr<DirectSession>( dynamic_cast<DirectSession*>(NewSession(options))); @@ -55,7 +58,7 @@ class SessionDebugMinusAXTest : public ::testing::Test { #elif defined(TENSORFLOW_USE_SYCL) const string kDeviceName = "/job:localhost/replica:0/task:0/device:SYCL:0"; #else - const string kDeviceName = "/job:localhost/replica:0/task:0/cpu:0"; + const string kDeviceName = "/job:localhost/replica:0/task:0/device:CPU:0"; #endif Tensor a_tensor(DT_FLOAT, TensorShape({2, 2})); @@ -503,7 +506,7 @@ TEST_F(SessionDebugMinusAXTest, } #endif -class SessionDebugOutputSlotWithoutOngoingEdgeTest : public ::testing::Test { +class SessionDebugOutputSlotWithoutOutgoingEdgeTest : public ::testing::Test { public: void Initialize() { Graph graph(OpRegistry::Global()); @@ -513,7 +516,7 @@ class SessionDebugOutputSlotWithoutOngoingEdgeTest : public ::testing::Test { #elif defined(TENSORFLOW_USE_SYCL) const string kDeviceName = "/job:localhost/replica:0/task:0/device:SYCL:0"; #else - const string kDeviceName = "/job:localhost/replica:0/task:0/cpu:0"; + const string kDeviceName = "/job:localhost/replica:0/task:0/device:CPU:0"; #endif Tensor a_tensor(DT_FLOAT, TensorShape({1, 1})); @@ -540,7 +543,7 @@ class SessionDebugOutputSlotWithoutOngoingEdgeTest : public ::testing::Test { GraphDef def_; }; -TEST_F(SessionDebugOutputSlotWithoutOngoingEdgeTest, +TEST_F(SessionDebugOutputSlotWithoutOutgoingEdgeTest, WatchSlotWithoutOutgoingEdge) { Initialize(); auto session = CreateSession(); @@ -615,7 +618,7 @@ class SessionDebugVariableTest : public ::testing::Test { #elif defined(TENSORFLOW_USE_SYCL) const string kDeviceName = "/job:localhost/replica:0/task:0/device:SYCL:0"; #else - const string kDeviceName = "/job:localhost/replica:0/task:0/cpu:0"; + const string kDeviceName = "/job:localhost/replica:0/task:0/device:CPU:0"; #endif // Define variable node. |