parent
36e073eba8
commit
b92e5a68c7
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* 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 "graph/passes/reshape_recovery_pass.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include "graph_builder_utils.h"
|
||||
|
||||
namespace ge {
|
||||
class UtestReshapeRecoveryPass : public testing::Test {
|
||||
protected:
|
||||
void SetUp() {}
|
||||
void TearDown() {}
|
||||
};
|
||||
|
||||
namespace {
|
||||
/// data
|
||||
/// |
|
||||
/// transdata
|
||||
/// |
|
||||
/// netoutput
|
||||
ComputeGraphPtr BuilderGraph1() {
|
||||
ut::GraphBuilder builder = ut::GraphBuilder("g1");
|
||||
auto data = builder.AddNode("data", "Data", 0, 1, FORMAT_ND, DT_FLOAT, {1, 3, 16, 16});
|
||||
auto transdata = builder.AddNode("transdata", "Transdata", 1, 1, FORMAT_ND, DT_FLOAT, {1, 3, 16, 16});
|
||||
auto netoutput = builder.AddNode("netoutput", "Netoutput", 1, 0, FORMAT_ND, DT_FLOAT, {1, 3, 16, 16});
|
||||
|
||||
builder.AddDataEdge(data, 0, transdata, 0);
|
||||
builder.AddDataEdge(transdata, 0, netoutput, 0);
|
||||
return builder.GetGraph();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(UtestReshapeRecoveryPass, test_reshape_recovery) {
|
||||
auto graph = BuilderGraph1();
|
||||
ReshapeRecoveryPass pass;
|
||||
EXPECT_EQ(pass.Run(graph), SUCCESS);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue