@@ -1,33 +0,0 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tuple>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "ngraph_functions/builders.hpp"
|
||||
#include "ngraph_functions/utils/ngraph_helpers.hpp"
|
||||
|
||||
#include "functional_test_utils/layer_test_utils.hpp"
|
||||
|
||||
namespace LayerTestsDefinitions {
|
||||
typedef std::tuple<
|
||||
InferenceEngine::Precision, // Network precision
|
||||
std::vector<std::vector<size_t>>, // Input shapes
|
||||
std::string, // Device name
|
||||
std::map<std::string, std::string> // Config
|
||||
> addParams;
|
||||
|
||||
class AddLayerTest : public testing::WithParamInterface<addParams>,
|
||||
public LayerTestsUtils::LayerTestsCommon {
|
||||
public:
|
||||
static std::string getTestCaseName(testing::TestParamInfo<addParams> obj);
|
||||
protected:
|
||||
void SetUp() override;
|
||||
};
|
||||
|
||||
} // namespace LayerTestsDefinitions
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <tuple>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "functional_test_utils/layer_test_utils.hpp"
|
||||
#include "ngraph_functions/builders.hpp"
|
||||
#include "ngraph_functions/utils/ngraph_helpers.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
namespace LayerTestsDefinitions {
|
||||
|
||||
using MultiplyParamsTuple = typename std::tuple<
|
||||
std::vector<std::vector<size_t>>, //input shapes
|
||||
InferenceEngine::Precision, //Network precision
|
||||
std::string>; //Device name
|
||||
|
||||
class MultiplyLayerTest:
|
||||
public testing::WithParamInterface<MultiplyParamsTuple>,
|
||||
public LayerTestsUtils::LayerTestsCommon{
|
||||
public:
|
||||
std::shared_ptr<ngraph::Function> fn;
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<MultiplyParamsTuple> &obj);
|
||||
protected:
|
||||
void SetUp() override;
|
||||
};
|
||||
} // namespace LayerTestsDefinitions
|
||||
@@ -1,48 +0,0 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <tuple>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <ie_core.hpp>
|
||||
|
||||
#include "functional_test_utils/blob_utils.hpp"
|
||||
#include "functional_test_utils/layer_test_utils.hpp"
|
||||
#include "common_test_utils/common_utils.hpp"
|
||||
#include "single_layer_tests/add.hpp"
|
||||
|
||||
namespace LayerTestsDefinitions {
|
||||
std::string AddLayerTest::getTestCaseName(testing::TestParamInfo<addParams> obj) {
|
||||
InferenceEngine::Precision netPrecision;
|
||||
std::vector<InferenceEngine::SizeVector> inputShapes;
|
||||
std::string targetDevice;
|
||||
std::map<std::string, std::string> config;
|
||||
std::tie(netPrecision, inputShapes, targetDevice, config) = obj.param;
|
||||
std::ostringstream result;
|
||||
result << "IS=" << CommonTestUtils::vec2str(inputShapes) << "_";
|
||||
result << "netPRC=" << netPrecision.name() << "_";
|
||||
result << "targetDevice=" << targetDevice;
|
||||
return result.str();
|
||||
}
|
||||
|
||||
void AddLayerTest::SetUp() {
|
||||
std::vector<InferenceEngine::SizeVector> inputShapes;
|
||||
InferenceEngine::Precision netPrecision;
|
||||
std::tie(netPrecision, inputShapes, targetDevice, configuration) = this->GetParam();
|
||||
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
|
||||
auto paramsIn = ngraph::builder::makeParams(ngPrc, {inputShapes});
|
||||
auto paramIn = ngraph::helpers::convert2OutputVector(
|
||||
ngraph::helpers::castOps2Nodes<ngraph::op::Parameter>(paramsIn));
|
||||
IE_ASSERT(paramIn.size() == 2);
|
||||
auto add = std::make_shared<ngraph::opset1::Add>(paramsIn[0], paramsIn[1]);
|
||||
ngraph::ResultVector results{std::make_shared<ngraph::opset1::Result>(add)};
|
||||
function = std::make_shared<ngraph::Function>(results, paramsIn, "Add");
|
||||
}
|
||||
|
||||
TEST_P(AddLayerTest, CompareWithRefs) {
|
||||
Run();
|
||||
}
|
||||
} // namespace LayerTestsDefinitions
|
||||
@@ -1,49 +0,0 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <tuple>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include <debug.h>
|
||||
#include "ie_core.hpp"
|
||||
#include "common_test_utils/common_utils.hpp"
|
||||
#include "functional_test_utils/blob_utils.hpp"
|
||||
#include "functional_test_utils/precision_utils.hpp"
|
||||
#include "functional_test_utils/plugin_cache.hpp"
|
||||
#include "functional_test_utils/skip_tests_config.hpp"
|
||||
#include "single_layer_tests/multiply.hpp"
|
||||
|
||||
namespace LayerTestsDefinitions {
|
||||
std::string MultiplyLayerTest::getTestCaseName(const testing::TestParamInfo<MultiplyParamsTuple> &obj) {
|
||||
std::vector<std::vector<size_t>> inputShapes;
|
||||
InferenceEngine::Precision netPrecision;
|
||||
std::string targetName;
|
||||
std::tie(inputShapes, netPrecision, targetName) = obj.param;
|
||||
std::ostringstream results;
|
||||
|
||||
results << "IS=" << CommonTestUtils::vec2str(inputShapes) << "_";
|
||||
results << "netPRC=" << netPrecision.name() << "_";
|
||||
results << "targetDevice=" << targetName << "_";
|
||||
return results.str();
|
||||
}
|
||||
|
||||
void MultiplyLayerTest::SetUp() {
|
||||
std::vector<std::vector<size_t>> inputShapes;
|
||||
InferenceEngine::Precision netPrecision;
|
||||
std::tie(inputShapes, netPrecision, targetDevice) = this->GetParam();
|
||||
const std::size_t input_dim = InferenceEngine::details::product(inputShapes[0]);
|
||||
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
|
||||
std::vector<size_t> shape_input{1, input_dim};
|
||||
auto input = ngraph::builder::makeParams(ngPrc, {shape_input});
|
||||
auto const_mul = ngraph::builder::makeConstant(ngPrc, ngraph::Shape{1}, std::vector<float>{-1.0f});
|
||||
auto mul = std::make_shared<ngraph::opset1::Multiply>(input[0], const_mul);
|
||||
function = std::make_shared<ngraph::Function>(mul, input, "multiply");
|
||||
}
|
||||
|
||||
TEST_P(MultiplyLayerTest, CompareWithRefs){
|
||||
Run();
|
||||
};
|
||||
} // namespace LayerTestsDefinitions
|
||||
Reference in New Issue
Block a user