Skip to content

Commit

Permalink
Merge pull request #5 from nosovmik/rename_transpose_sinking
Browse files Browse the repository at this point in the history
Rename 'transpose_sinking' for TensorFlow
  • Loading branch information
nosovmik authored Apr 14, 2021
2 parents e01d1dc + e6dc71b commit 08c728c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 53 deletions.
19 changes: 19 additions & 0 deletions ngraph/core/include/ngraph/pass/core_transpose_sinking.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

#pragma once

#include <ngraph/pass/pass.hpp>
#include <ngraph/util.hpp>

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<ngraph::Function> function) override;
};

} // namespace pass
} // namespace ngraph
34 changes: 0 additions & 34 deletions ngraph/core/include/ngraph/pass/transpose_sinking.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 <algorithm>
#include <iostream>
#include <numeric>
Expand All @@ -24,7 +11,7 @@
#include <ngraph/pattern/op/label.hpp>
#include <ngraph/util.hpp>

#include <ngraph/pass/transpose_sinking.h>
#include <ngraph/pass/core_transpose_sinking.h>

using namespace std;

Expand Down Expand Up @@ -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<ngraph::Function> f)
bool CoreTransposeSinking::run_on_function(shared_ptr<ngraph::Function> f)
{
TransposeMap reorders;
set<shared_ptr<ngraph::Node>> transposes_to_delete;
Expand Down
4 changes: 2 additions & 2 deletions ngraph/frontend/tensorflow/src/tensorflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <fstream>

#include <ngraph/pass/manager.hpp>
#include <ngraph/pass/transpose_sinking.h>
#include <ngraph/pass/core_transpose_sinking.h>
#include <ngraph/pass/constant_folding.hpp>

#include "graph.pb.h"
Expand Down Expand Up @@ -66,7 +66,7 @@ std::shared_ptr<ngraph::Function> ngraph::frontend::FrontEndTensorflow::convert
std::cerr << "[ STATUS ] Running Transpose Sinking transformation\n";

ngraph::pass::Manager manager;
manager.register_pass<ngraph::pass::TransposeSinking>();
manager.register_pass<ngraph::pass::CoreTransposeSinking>();
manager.register_pass<ngraph::pass::ConstantFolding>();
manager.run_passes(f);

Expand Down

0 comments on commit 08c728c

Please sign in to comment.