From e6dc71b572b46ead4d6b0028e17c56576d986afb Mon Sep 17 00:00:00 2001 From: Michael Nosov Date: Wed, 14 Apr 2021 15:36:25 +0300 Subject: [PATCH] Rename 'transpose_sinking' for TensorFlow --- .../ngraph/pass/core_transpose_sinking.h | 19 +++++++++++ .../include/ngraph/pass/transpose_sinking.h | 34 ------------------- ...sinking.cpp => core_transpose_sinking.cpp} | 21 +++--------- ngraph/frontend/tensorflow/src/tensorflow.cpp | 4 +-- 4 files changed, 25 insertions(+), 53 deletions(-) create mode 100644 ngraph/core/include/ngraph/pass/core_transpose_sinking.h delete mode 100644 ngraph/core/include/ngraph/pass/transpose_sinking.h rename ngraph/core/src/pass/{transpose_sinking.cpp => core_transpose_sinking.cpp} (96%) diff --git a/ngraph/core/include/ngraph/pass/core_transpose_sinking.h b/ngraph/core/include/ngraph/pass/core_transpose_sinking.h new file mode 100644 index 00000000000000..374a3d56ea67e6 --- /dev/null +++ b/ngraph/core/include/ngraph/pass/core_transpose_sinking.h @@ -0,0 +1,19 @@ + +#pragma once + +#include +#include + +namespace ngraph { +namespace pass { + +class NGRAPH_API CoreTransposeSinking : public ngraph::pass::FunctionPass { + public: + CoreTransposeSinking() { + set_property(ngraph::pass::PassProperty::REQUIRE_STATIC_SHAPE, true); + } + bool run_on_function(std::shared_ptr function) override; +}; + +} // namespace pass +} // namespace ngraph diff --git a/ngraph/core/include/ngraph/pass/transpose_sinking.h b/ngraph/core/include/ngraph/pass/transpose_sinking.h deleted file mode 100644 index 0a649bc21b0830..00000000000000 --- a/ngraph/core/include/ngraph/pass/transpose_sinking.h +++ /dev/null @@ -1,34 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#pragma once - -#include -#include - -namespace ngraph { -namespace pass { - -class NGRAPH_API TransposeSinking : public ngraph::pass::FunctionPass { - public: - TransposeSinking() { - set_property(ngraph::pass::PassProperty::REQUIRE_STATIC_SHAPE, true); - } - bool run_on_function(std::shared_ptr function) override; -}; - -} // namespace pass -} // namespace ngraph diff --git a/ngraph/core/src/pass/transpose_sinking.cpp b/ngraph/core/src/pass/core_transpose_sinking.cpp similarity index 96% rename from ngraph/core/src/pass/transpose_sinking.cpp rename to ngraph/core/src/pass/core_transpose_sinking.cpp index 79652139649cbb..fb0913c48326e1 100644 --- a/ngraph/core/src/pass/transpose_sinking.cpp +++ b/ngraph/core/src/pass/core_transpose_sinking.cpp @@ -1,19 +1,6 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation +// Copyright (C) 2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - #include #include #include @@ -24,7 +11,7 @@ #include #include -#include +#include using namespace std; @@ -460,7 +447,7 @@ namespace ngraph // For each op type we support we can either combine // two transposes by replacing the existing Transpose, // materialize pending transposes if they can't be propagated through op - bool TransposeSinking::run_on_function(shared_ptr f) + bool CoreTransposeSinking::run_on_function(shared_ptr f) { TransposeMap reorders; set> transposes_to_delete; diff --git a/ngraph/frontend/tensorflow/src/tensorflow.cpp b/ngraph/frontend/tensorflow/src/tensorflow.cpp index b3280022f3e374..5ee5b7b3240d3b 100644 --- a/ngraph/frontend/tensorflow/src/tensorflow.cpp +++ b/ngraph/frontend/tensorflow/src/tensorflow.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include "graph.pb.h" @@ -66,7 +66,7 @@ std::shared_ptr ngraph::frontend::FrontEndTensorflow::convert std::cerr << "[ STATUS ] Running Transpose Sinking transformation\n"; ngraph::pass::Manager manager; - manager.register_pass(); + manager.register_pass(); manager.register_pass(); manager.run_passes(f);