correct add/sub/div/mul/addn/cast/unique and add ut

pull/4102/head
xuanyue 5 years ago
parent 68fc7c2c1f
commit bf97e6a33a

@ -384,15 +384,19 @@ table Eltwise {
}
table Add {
activationType : ActivationType;
}
table Sub {
activationType : ActivationType;
}
table Mul {
activationType : ActivationType;
}
table Div {
activationType : ActivationType;
}
table AddGrad {

@ -0,0 +1,44 @@
/**
* Copyright 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 "ut/tools/converter/parser/tflite/tflite_parsers_test_utils.h"
#include <iostream>
#include "common/common_test.h"
namespace mindspore {
class TestTfliteParserAddN : public TestTfliteParser {
public:
TestTfliteParserAddN() {}
void SetUp() override {
meta_graph = LoadAndConvert("./addn.tflite");
}
};
TEST_F(TestTfliteParserAddN, OpType) {
ASSERT_NE(meta_graph, nullptr);
ASSERT_GT(meta_graph->nodes.size(), 0);
ASSERT_NE(meta_graph->nodes.front()->primitive.get(), nullptr);
ASSERT_EQ(meta_graph->nodes.front()->primitive->value.type, schema::PrimitiveType_AddN) << "wrong Op Type";
}
TEST_F(TestTfliteParserAddN, AttrValue) {
ASSERT_NE(meta_graph, nullptr);
ASSERT_GT(meta_graph->nodes.size(), 0);
ASSERT_NE(meta_graph->nodes.front()->primitive.get(), nullptr);
ASSERT_NE(meta_graph->nodes.front()->primitive->value.AsAddN(), nullptr);
ASSERT_EQ(meta_graph->nodes.front()->primitive->value.AsAddN()->N, 4);
}
} // namespace mindspore

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save