Browse Source

Add ut.

pull/1190/head
unknown 5 years ago
parent
commit
f6ba21ed1d
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      tests/ut/ge/graph/passes/transpose_transdata_pass_unittest.cc

+ 5
- 5
tests/ut/ge/graph/passes/transpose_transdata_pass_unittest.cc View File

@@ -30,7 +30,7 @@
#include "graph/debug/ge_attr_define.h"

namespace ge {
class UtestGraphPassesTransposeTransDataPass : public testing::Test {
class UtestGraphPassesTransposeTransdataPass : public testing::Test {
protected:
void SetUp() {}
void TearDown() {}
@@ -40,11 +40,11 @@ static ComputeGraphPtr BuildGraphTransposeD() {
auto builder = ut::GraphBuilder("g1");
auto transdata1 = builder.AddNode("transdata1", "TransData", 1, 1, FORMAT_NC1HWC0, DT_FLOAT, std::vector<int64_t>({1, 1, 224, 224, 16}));
transdata1->GetOpDesc()->MutableOutputDesc(0)->SetFormat(FORMAT_NHWC);
transdata1->GetOpDesc()->MutableOutputDesc(0)->SetShape(GeShape(std::vector<int64_t>({1, 1, 224, 224, 3})));
transdata1->GetOpDesc()->MutableOutputDesc(0)->SetShape(GeShape(std::vector<int64_t>({1, 224, 224, 3})));

auto transpose1 = builder.AddNode("transpose1", "TransposeD", 1, 1, FORMAT_NCHW, DT_FLOAT, std::vector<int64_t>({1, 3, 224, 224}));
transpose1->GetOpDesc()->MutableIntputDesc(0)->SetFormat(FORMAT_NHWC);
transpose1->GetOpDesc()->MutableIntputDesc(0)->SetShape(GeShape(std::vector<int64_t>({1, 1, 224, 224, 3})));
transpose1->GetOpDesc()->MutableInputDesc(0)->SetFormat(FORMAT_NHWC);
transpose1->GetOpDesc()->MutableInputDesc(0)->SetShape(GeShape(std::vector<int64_t>({1, 224, 224, 3})));

auto transdata2 = builder.AddNode("transdata2", "TransData", 1, 1, FORMAT_NCHW, DT_FLOAT, std::vector<int64_t>({1, 3, 224, 224}));
transdata2->GetOpDesc()->MutableOutputDesc(0)->SetFormat(FORMAT_NC1HWC0);
@@ -56,7 +56,7 @@ static ComputeGraphPtr BuildGraphTransposeD() {
return builder.GetGraph();
}

TEST_F(UtestGraphPassesTransposeTransDataPass, test_run) {
TEST_F(UtestGraphPassesTransposeTransdataPass, test_run) {
auto compute_graph = BuildGraphTransposeD();
compute_graph->SetSessionID(0);



Loading…
Cancel
Save