Skip to content

Commit

Permalink
Add tests for MinMax, DepthToSpace (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnamrata15 authored and YangleiZouIntel committed Jan 14, 2021
1 parent 9e8ae13 commit ab13bb4
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <vector>
#include <ngraph/opsets/opset3.hpp>

#include "single_layer_tests/depth_to_space.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;
using namespace ngraph::opset3;

namespace {
const std::vector<InferenceEngine::Precision> inputPrecisions = {
InferenceEngine::Precision::FP32,
//InferenceEngine::Precision::U8,
//InferenceEngine::Precision::I16,
};

const std::vector<DepthToSpace::DepthToSpaceMode> modes = {
DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST,
DepthToSpace::DepthToSpaceMode::DEPTH_FIRST};

const std::vector<std::vector<size_t >> inputShapesBS2 = {
{1, 4, 1, 1}, {1, 4, 2, 2}, {1, 4, 3, 3}, {2, 32, 3, 3}, {2, 16, 5, 4},
{1, 8, 1, 1, 1}, {1, 8, 2, 2, 2}, {1, 8, 3, 3, 3}, {2, 32, 3, 3, 3}, {2, 16, 5, 4, 6}};

const auto DepthToSpaceBS2 = ::testing::Combine(
::testing::ValuesIn(inputShapesBS2),
::testing::ValuesIn(inputPrecisions),
::testing::ValuesIn(modes),
::testing::Values(2),
::testing::Values(CommonTestUtils::DEVICE_PLAIDML)
);

INSTANTIATE_TEST_CASE_P(DepthToSpaceBS2, DepthToSpaceLayerTest, DepthToSpaceBS2, DepthToSpaceLayerTest::getTestCaseName);

const std::vector<std::vector<size_t >> inputShapesBS3 = {
{1, 9, 1, 1}, {1, 9, 2, 2}, {1, 9, 3, 3}, {2, 36, 3, 3}, {2, 27, 5, 4},
{1, 27, 1, 1, 1}, {1, 27, 2, 2, 2}, {1, 27, 3, 3, 3}, {2, 108, 3, 3, 3}, {2, 54, 5, 4, 6}};

const auto DepthToSpaceBS3 = ::testing::Combine(
::testing::ValuesIn(inputShapesBS3),
::testing::ValuesIn(inputPrecisions),
::testing::ValuesIn(modes),
::testing::Values(3),
::testing::Values(CommonTestUtils::DEVICE_PLAIDML)
);

INSTANTIATE_TEST_CASE_P(DepthToSpaceBS3, DepthToSpaceLayerTest, DepthToSpaceBS3, DepthToSpaceLayerTest::getTestCaseName);

} // namespace

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <vector>
#include "single_layer_tests/minimum_maximum.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;

namespace {

const std::vector<std::vector<std::vector<size_t>>> inShapes = {
{{2}, {1}},
{{1, 1, 1, 3}, {1}},
{{1, 2, 4}, {1}},
{{1, 4, 4}, {1}},
{{1, 4, 4, 1}, {1}},
{{256, 56}, {256, 56}},
{{8, 1, 6, 1}, {7, 1, 5}},
};

const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
//InferenceEngine::Precision::FP16,
};

const std::vector<ngraph::helpers::MinMaxOpType> opType = {
ngraph::helpers::MinMaxOpType::MINIMUM,
ngraph::helpers::MinMaxOpType::MAXIMUM,
};

const std::vector<ngraph::helpers::InputLayerType> inputType = {
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
};

INSTANTIATE_TEST_CASE_P(maximum, MaxMinLayerTest,
::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(opType),
::testing::ValuesIn(netPrecisions),
::testing::ValuesIn(inputType),
::testing::Values(CommonTestUtils::DEVICE_PLAIDML)),
MaxMinLayerTest::getTestCaseName);

} // namespace

0 comments on commit ab13bb4

Please sign in to comment.