From 241ed05c64e07b929e642e5df2b6f24d31953f63 Mon Sep 17 00:00:00 2001 From: raver119 Date: Mon, 24 Feb 2020 21:58:23 +0300 Subject: [PATCH] VariableSpace uses unordered maps as well (#270) Signed-off-by: raver119 --- libnd4j/include/graph/VariableSpace.h | 8 ++++---- libnd4j/tests_cpu/layers_tests/PlaygroundTests.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libnd4j/include/graph/VariableSpace.h b/libnd4j/include/graph/VariableSpace.h index 81abaf6e8..94cdf6bb0 100644 --- a/libnd4j/include/graph/VariableSpace.h +++ b/libnd4j/include/graph/VariableSpace.h @@ -45,9 +45,9 @@ namespace nd4j { // stash is NOT cloned nd4j::graph::Stash _stash; - std::map, Variable*> _paired; - std::map _symbolic; - std::map _variables; + MAP_IMPL, Variable*> _paired; + MAP_IMPL _symbolic; + MAP_IMPL _variables; std::vector _external; std::vector _internal; @@ -61,7 +61,7 @@ namespace nd4j { std::mutex _varmap; - std::map _temporary; + MAP_IMPL _temporary; std::vector *_handles; diff --git a/libnd4j/tests_cpu/layers_tests/PlaygroundTests.cpp b/libnd4j/tests_cpu/layers_tests/PlaygroundTests.cpp index 93fb5d6b3..24cbe1d5c 100644 --- a/libnd4j/tests_cpu/layers_tests/PlaygroundTests.cpp +++ b/libnd4j/tests_cpu/layers_tests/PlaygroundTests.cpp @@ -111,7 +111,7 @@ TEST_F(PlaygroundTests, test_bert_1) { graph->getVariableSpace()->putVariable(86,0, u); graph->getVariableSpace()->putVariable(87,0, v); -/* + // validating graph now auto status = GraphExecutioner::execute(graph); ASSERT_EQ(Status::OK(), status); @@ -119,8 +119,8 @@ TEST_F(PlaygroundTests, test_bert_1) { auto array = graph->getVariableSpace()->getVariable(198)->getNDArray(); ASSERT_EQ(z, *array); -*/ +/* nd4j::Environment::getInstance()->setProfiling(true); auto profile = GraphProfilingHelper::profile(graph, 1); @@ -128,7 +128,7 @@ TEST_F(PlaygroundTests, test_bert_1) { nd4j::Environment::getInstance()->setProfiling(false); delete profile; - +*/ /* std::vector values;