diff --git a/docs/doxygen/ie_docs.xml b/docs/doxygen/ie_docs.xml index 0132ecede25..b68c0f39d95 100644 --- a/docs/doxygen/ie_docs.xml +++ b/docs/doxygen/ie_docs.xml @@ -262,6 +262,7 @@ limitations under the License. + diff --git a/docs/ops/activation/SoftMax_8.md b/docs/ops/activation/SoftMax_8.md new file mode 100644 index 00000000000..170d5802d60 --- /dev/null +++ b/docs/ops/activation/SoftMax_8.md @@ -0,0 +1,45 @@ +## SoftMax {#openvino_docs_ops_activation_SoftMax_8} + +**Versioned name**: *SoftMax-8* + +**Category**: *Activation function* + +**Short description**: [Reference](https://github.com/Kulbear/deep-learning-nano-foundation/wiki/ReLU-and-Softmax-Activation-Functions#softmax) + +**Detailed description**: [Reference](http://cs231n.github.io/linear-classify/#softmax) + +**Attributes** + +* *axis* + + * **Description**: *axis* represents the axis of which the *SoftMax* is calculated. Negative value means counting + dimensions from the back. *axis* equal 1 is a default value. + * **Range of values**: `[-rank, rank - 1]` + * **Type**: int + * **Default value**: 1 + * **Required**: *no* + +**Mathematical Formulation** + +\f[ +y_{c} = \frac{e^{Z_{c}}}{\sum_{d=1}^{C}e^{Z_{d}}} +\f] +where \f$C\f$ is a size of tensor along *axis* dimension. + +**Inputs**: + +* **1**: Input tensor with enough number of dimension to be compatible with *axis* attribute. **Required.** + +**Outputs**: + +* **1**: The resulting tensor of the same shape and type as input tensor. + +**Example** + +```xml + + + ... + ... + +``` diff --git a/docs/ops/opset8.md b/docs/ops/opset8.md index 385dfa173a5..657fa4be55d 100644 --- a/docs/ops/opset8.md +++ b/docs/ops/opset8.md @@ -152,7 +152,7 @@ declared in `namespace opset8`. * [Sign](arithmetic/Sign_1.md) * [Sin](arithmetic/Sin_1.md) * [Sinh](arithmetic/Sinh_1.md) -* [SoftMax](activation/SoftMax_1.md) +* [SoftMax](activation/SoftMax_8.md) * [SoftPlus](activation/SoftPlus_4.md) * [SpaceToBatch](movement/SpaceToBatch_2.md) * [SpaceToDepth](movement/SpaceToDepth_1.md) diff --git a/docs/template_plugin/src/template_executable_network.cpp b/docs/template_plugin/src/template_executable_network.cpp index 9819d76ba7c..237cbeaa712 100644 --- a/docs/template_plugin/src/template_executable_network.cpp +++ b/docs/template_plugin/src/template_executable_network.cpp @@ -113,8 +113,9 @@ void TemplatePlugin::ExecutableNetwork::CompileNetwork(const std::shared_ptrget_results()) { - auto outputName = ngraph::op::util::create_ie_output_name(result->input_value(0)); - _outputIndex.emplace(outputName, _function->get_result_index(result)); + const auto& input = result->input_value(0); + auto name = ngraph::op::util::get_ie_output_name(input); + _outputIndex.emplace(name, _function->get_result_index(result)); } for (auto&& parameter : _function->get_parameters()) { _inputIndex.emplace(parameter->get_friendly_name(), _function->get_parameter_index(parameter)); diff --git a/docs/template_plugin/tests/functional/CMakeLists.txt b/docs/template_plugin/tests/functional/CMakeLists.txt index a2962cea0ae..7632b4bb8c3 100644 --- a/docs/template_plugin/tests/functional/CMakeLists.txt +++ b/docs/template_plugin/tests/functional/CMakeLists.txt @@ -10,6 +10,7 @@ addIeTargetTest( ROOT ${CMAKE_CURRENT_SOURCE_DIR} DEPENDENCIES templatePlugin + HeteroPlugin LINK_LIBRARIES IE::funcSharedTests INCLUDES diff --git a/docs/template_plugin/tests/functional/op_reference/base_reference_test.cpp b/docs/template_plugin/tests/functional/op_reference/base_reference_test.cpp index dd5a5b24dd6..97b76d1756e 100644 --- a/docs/template_plugin/tests/functional/op_reference/base_reference_test.cpp +++ b/docs/template_plugin/tests/functional/op_reference/base_reference_test.cpp @@ -17,7 +17,7 @@ using namespace ov; namespace reference_tests { CommonReferenceTest::CommonReferenceTest(): targetDevice("TEMPLATE") { - core = ov::test::PluginCache::get().core(targetDevice); + core = test::utils::PluginCache::get().core(targetDevice); } void CommonReferenceTest::Exec() { diff --git a/docs/template_plugin/tests/functional/op_reference/binary_convolution.cpp b/docs/template_plugin/tests/functional/op_reference/binary_convolution.cpp new file mode 100644 index 00000000000..1a9a8e3ad68 --- /dev/null +++ b/docs/template_plugin/tests/functional/op_reference/binary_convolution.cpp @@ -0,0 +1,316 @@ +// Copyright (C) 2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include +#include "openvino/op/binary_convolution.hpp" +#include "base_reference_test.hpp" +#include "openvino/opsets/opset8.hpp" + +using namespace reference_tests; +using namespace ov; + +namespace { +struct BinaryConvolutionParams { + template + BinaryConvolutionParams(const PartialShape& inputShape, + const Shape& filterShape, + const PartialShape& outputShape, + const element::Type& iType, + const std::vector& iValues, + const std::vector& filterValues, + const std::vector& oValues, + const Strides& strides, + const CoordinateDiff& padBegin, + const CoordinateDiff& padEnd, + const Strides& dialations, + const float padValue = 0, + const std::string& test_name = "") + : inputShape(inputShape), + filterShape(filterShape), + outputShape(outputShape), + inType(iType), + outType(iType), + inputData(CreateTensor(iType, iValues)), + filterData(filterValues), + refData(CreateTensor(iType, oValues)), + strides(strides), + padBegin(padBegin), + padEnd(padEnd), + dialations(dialations), + padValue(padValue) {} + + PartialShape inputShape; + Shape filterShape; + PartialShape outputShape; + ov::element::Type inType; + ov::element::Type outType; + ov::runtime::Tensor inputData; + std::vector filterData; + ov::runtime::Tensor refData; + ov::Strides strides; + ov::CoordinateDiff padBegin; + ov::CoordinateDiff padEnd; + ov::Strides dialations; + ov::op::v1::BinaryConvolution::BinaryConvolutionMode mode = ov::op::v1::BinaryConvolution::BinaryConvolutionMode::XNOR_POPCOUNT; + float padValue; + std::string testcaseName; +}; + +class ReferenceBinaryConvolutionLayerTest : public testing::TestWithParam, public CommonReferenceTest { +public: + void SetUp() override { + auto params = GetParam(); + function = CreateFunction(params, params.filterData); + inputData = {params.inputData}; + refOutData = {params.refData}; + } + static std::string getTestCaseName(const testing::TestParamInfo& obj) { + auto param = obj.param; + std::ostringstream result; + result << "inputShape=" << param.inputShape << "_"; + result << "filterShape=" << param.filterShape << "_"; + result << "outputShape=" << param.outputShape << "_"; + result << "iType=" << param.inType << "_"; + result << "oType=" << param.outType << "_"; + result << "strides=" << param.strides << "_"; + result << "padBegin=" << param.padBegin << "_"; + result << "padEnd=" << param.padEnd << "_"; + result << "dialations=" << param.dialations << "_"; + if (param.testcaseName != "") { + result << "padValue=" << param.padValue << "_"; + result << param.testcaseName; + } else { + result << "padValue=" << param.padValue; + } + return result.str(); + } + +private: + static std::shared_ptr CreateFunction(const BinaryConvolutionParams& params, const std::vector& filterData) { + const op::PadType auto_pad{op::PadType::EXPLICIT}; + const auto in = std::make_shared(params.inType, params.inputShape); + auto filter = std::make_shared(ov::element::u1, params.filterShape, &filterData[0]); + const auto BinaryConvolution = std::make_shared(in, + filter, + params.strides, + params.padBegin, + params.padEnd, + params.dialations, + params.mode, + params.padValue, + auto_pad); + return std::make_shared(NodeVector {BinaryConvolution}, ParameterVector {in}); + } +}; + +TEST_P(ReferenceBinaryConvolutionLayerTest, CompareWithRefs) { + Exec(); +} + +template +std::vector generateBinaryConvolutionParams() { + using T = typename element_type_traits::value_type; + + std::vector binaryConvolutionParams { +// --------------------- 2D BinaryConvolution ------------------------------------------ + BinaryConvolutionParams(PartialShape {1, 1, 4, 4}, + Shape {1, 1, 3, 3}, + PartialShape {1, 1, 2, 2}, + IN_ET, + std::vector{1, 0, 0, 1, + 1, 1, 0, 0, + 0, 0, 0, 1, + 1, 0, 1, 1}, + std::vector{0xAA, 0x80}, // 10101010 10000000 + std::vector{1, 1, + 3, -1}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}), + BinaryConvolutionParams(PartialShape {1, 1, 4, 4}, + Shape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{1, 0, 0, 1, + 1, 1, 0, 0, + 0, 0, 0, 1, + 1, 0, 1, 1}, + std::vector{0xAA, 0x80}, // 10101010 10000000 + std::vector{1, -3, -1, 1, + -3, 1, 1, -5, + -3, 3, -1, 1, + 1, -5, 1, -3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}), + BinaryConvolutionParams(PartialShape {1, 1, 4, 4}, + Shape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{1, 0, 0, 1, + 1, 1, 0, 0, + 0, 0, 0, 1, + 1, 0, 1, 1}, + std::vector{0xAA, 0x80}, // 10101010 10000000 + std::vector{3, -1, 1, 3, + -1, 1, 1, -3, + -1, 3, -1, 3, + 3, -3, 3, -1}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + 1.0f), + BinaryConvolutionParams(PartialShape {1, 1, 5, 5}, + Shape {1, 1, 3, 3}, + PartialShape {1, 1, 2, 2}, + IN_ET, + std::vector{0, 1, 1, 0, 1, + 1, 1, 0, 1, 0, + 0, 0, 1, 0, 1, + 1, 1, 0, 1, 0, + 0, 0, 1, 1, 1}, + std::vector{0x2E, 0x00}, // 10101010 10000000 + std::vector{-1, 3, + 1, 1}, + {2, 2}, + {0, 0}, + {0, 0}, + {1, 1}), + BinaryConvolutionParams(PartialShape {1, 1, 7, 7}, + Shape {1, 1, 3, 3}, + PartialShape {1, 1, 3, 3}, + IN_ET, + std::vector{1, 1, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 0, + 1, 1, 1, 1, 0, 1, 1, + 0, 0, 0, 1, 1, 1, 0, + 0, 1, 0, 0, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 0, + 1, 1, 1, 0, 1, 0, 0}, + std::vector{0x6B, 0x00}, // 10101010 10000000 + std::vector{-5, -3, -5, + 5, 1, 3, + -1, -1, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {2, 2}), + BinaryConvolutionParams(PartialShape {1, 1, 7, 7}, + Shape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{1, 1, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 0, + 1, 1, 1, 1, 0, 1, 1, + 0, 0, 0, 1, 1, 1, 0, + 0, 1, 0, 0, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 0, + 1, 1, 1, 0, 1, 0, 0}, + std::vector{0x6B, 0x00}, // 10101010 10000000 + std::vector{1, 1, -1, 1, + 1, -5, -5, 5, + 3, -1, 3, 3, + -1, -1, 3, -3}, + {2, 2}, + {2, 2}, + {2, 2}, + {2, 2}), + BinaryConvolutionParams(PartialShape {1, 1, 7, 7}, + Shape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{1, 1, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 0, + 1, 1, 1, 1, 0, 1, 1, + 0, 0, 0, 1, 1, 1, 0, + 0, 1, 0, 0, 1, 1, 1, + 1, 0, 1, 1, 0, 0, 0, + 1, 1, 1, 0, 1, 0, 0}, + std::vector{0x6B, 0x00}, // 10101010 10000000 + std::vector{3, 3, 1, -1, + -1, -5, -5, 3, + 1, -1, 3, 1, + -3, 1, 5, -1}, + {2, 2}, + {2, 2}, + {2, 2}, + {2, 2}, + 1.0f), + BinaryConvolutionParams(PartialShape {1, 2, 4, 4}, + Shape {1, 2, 3, 3}, + PartialShape {1, 1, 2, 2}, + IN_ET, + std::vector{ + // channel 1 + 1, 0, 0, 1, + 1, 1, 0, 0, + 0, 0, 0, 1, + 1, 0, 1, 1, + // channel 2 + 0, 1, 1, 0, + 0, 0, 1, 1, + 1, 1, 1, 0, + 0, 1, 0, 0}, + std::vector{0xAA, 0xAA, 0x80}, // 10101010 10000000 + std::vector{2, 2, + 6, -2}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}), + BinaryConvolutionParams(PartialShape {2, 1, 4, 4}, + Shape {1, 1, 3, 3}, + PartialShape {2, 1, 2, 2}, + IN_ET, + std::vector{ + // batch 1 + 1, 0, 0, 1, + 1, 1, 0, 0, + 0, 0, 0, 1, + 1, 0, 1, 1, + // batch 2 + 0, 0, 0, 0, + 1, 1, 1, 0, + 1, 1, 0, 1, + 1, 0, 1, 0}, + std::vector{0xAA, 0x80}, // 10101010 10000000 + std::vector{ + // batch 1 + 1, 1, + 3, -1, + // batch 2 + -3, 3, + 5, -7}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}) + }; + return binaryConvolutionParams; +} + +std::vector generateBinaryConvolutionCombinedParams() { + const std::vector> binaryConvolutionTypeParams { + generateBinaryConvolutionParams(), + generateBinaryConvolutionParams(), + generateBinaryConvolutionParams(), + generateBinaryConvolutionParams() + }; + std::vector combinedParams; + + for (const auto& params : binaryConvolutionTypeParams) { + combinedParams.insert(combinedParams.end(), params.begin(), params.end()); + } + return combinedParams; +} + +INSTANTIATE_TEST_SUITE_P(smoke_BinaryConvolution_With_Hardcoded_Refs, ReferenceBinaryConvolutionLayerTest, + testing::ValuesIn(generateBinaryConvolutionCombinedParams()), ReferenceBinaryConvolutionLayerTest::getTestCaseName); + +} // namespace \ No newline at end of file diff --git a/docs/template_plugin/tests/functional/op_reference/convolution_backprop.cpp b/docs/template_plugin/tests/functional/op_reference/convolution_backprop.cpp new file mode 100644 index 00000000000..12274560e9f --- /dev/null +++ b/docs/template_plugin/tests/functional/op_reference/convolution_backprop.cpp @@ -0,0 +1,1776 @@ +// Copyright (C) 2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include "openvino/op/convolution.hpp" +#include "base_reference_test.hpp" + +using namespace reference_tests; +using namespace ov; + +namespace { +struct ConvolutionBackpropParams { + template + ConvolutionBackpropParams(const PartialShape& inputShape, const PartialShape& filterShape, const PartialShape& outputShape, + const element::Type& iType, + const std::vector& iValues, const std::vector& filterValues, const std::vector& oValues, + const Strides& strides, const CoordinateDiff& padBegin, const CoordinateDiff& padEnd, const Strides& dialations) + : inputShape(inputShape), + filterShape(filterShape), + outputShape(outputShape), + inType(iType), + filterType(iType), + outType(iType), + inputData(CreateTensor(iType, iValues)), + filterData(CreateTensor(iType, filterValues)), + refData(CreateTensor(iType, oValues)), + strides(strides), + padBegin(padBegin), + padEnd(padEnd), + dialations(dialations) {} + + template + ConvolutionBackpropParams(const PartialShape& inputShape, const PartialShape& filterShape, const PartialShape& outputShape, + const element::Type& iType, + const std::vector& iValues, const std::vector& filterValues, const std::vector& oValues, + const Strides& strides, const CoordinateDiff& padBegin, const CoordinateDiff& padEnd, const Strides& dialations, + const CoordinateDiff& outPadding) + : inputShape(inputShape), + filterShape(filterShape), + outputShape(outputShape), + inType(iType), + filterType(iType), + outType(iType), + inputData(CreateTensor(iType, iValues)), + filterData(CreateTensor(iType, filterValues)), + refData(CreateTensor(iType, oValues)), + strides(strides), + padBegin(padBegin), + padEnd(padEnd), + dialations(dialations), + outPadding(outPadding) {} + + PartialShape inputShape; + PartialShape filterShape; + PartialShape outputShape; + ov::element::Type inType; + ov::element::Type filterType; + ov::element::Type outType; + ov::runtime::Tensor inputData; + ov::runtime::Tensor filterData; + ov::runtime::Tensor refData; + ov::Strides strides; + ov::CoordinateDiff padBegin; + ov::CoordinateDiff padEnd; + ov::Strides dialations; + ov::CoordinateDiff outPadding; +}; + +class ReferenceConvolutionBackpropLayerTest : public testing::TestWithParam, public CommonReferenceTest { +public: + void SetUp() override { + auto params = GetParam(); + function = CreateFunction(params); + inputData = {params.inputData, params.filterData}; + refOutData = {params.refData}; + } + static std::string getTestCaseName(const testing::TestParamInfo& obj) { + auto param = obj.param; + std::ostringstream result; + result << "inputShape=" << param.inputShape << "_"; + result << "filterShape=" << param.filterShape << "_"; + result << "outputShape=" << param.outputShape << "_"; + result << "iType=" << param.inType << "_"; + result << "oType=" << param.outType << "_"; + result << "strides=" << param.strides << "_"; + result << "padBegin=" << param.padBegin << "_"; + result << "padEnd=" << param.padEnd << "_"; + result << "dialations=" << param.dialations << "_"; + result << "outPadding=" << param.outPadding; + return result.str(); + } + +private: + static std::shared_ptr CreateFunction(const ConvolutionBackpropParams& params) { + const op::PadType auto_pad{op::PadType::EXPLICIT}; + + const auto in = std::make_shared(params.inType, params.inputShape); + const auto filter = std::make_shared(params.inType, params.filterShape); + const auto ConvolutionBackprop = std::make_shared(in, + filter, + params.strides, + params.padBegin, + params.padEnd, + params.dialations, + auto_pad, + params.outPadding); + + return std::make_shared(NodeVector {ConvolutionBackprop}, ParameterVector {in, filter}); + } +}; + +TEST_P(ReferenceConvolutionBackpropLayerTest, CompareWithRefs) { + Exec(); +} + +template +std::vector generateConvolutionBackpropFloatParams() { + using T = typename element_type_traits::value_type; + + std::vector convolutionBackpropParams { +// --------------------- 1D ConvolutionBackprop ------------------------------------------ + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 6}, + IN_ET, + std::vector{5, 6, 7, 2}, + std::vector{2, 0, 1}, + std::vector{10, 12, 19, 10, 7, 2}, + {1}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 4}, + IN_ET, + std::vector{5, 6, 7, 2}, + std::vector{2, 0, 1}, + std::vector{12, 19, 10, 7}, + {1}, + {1}, + {1}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 5}, + IN_ET, + std::vector{5, 7}, + std::vector{2, 0, 1}, + std::vector{10, 0, 19, 0, 7}, + {2}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 5}, + IN_ET, + std::vector{5, 6, 7, 2}, + std::vector{2, 0, 1}, + std::vector{12, 19, 10, 7, 2}, + {1}, + {1}, + {1}, + {1}, + {1}), + ConvolutionBackpropParams(PartialShape {1, 1, 3}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 7}, + IN_ET, + std::vector{8, 5, 1}, + std::vector{2, 0, 1}, + std::vector{16, 10, 2, 0, 8, 5, 1}, + {1}, + {0}, + {0}, + {2}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 7}, + IN_ET, + std::vector{3, 9, 1, 2}, + std::vector{2, 0, 1}, + std::vector{18, 0, 5, 0, 13, 0, 1}, + {2}, + {2}, + {2}, + {2}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2}, + PartialShape {1, 2, 3}, + PartialShape {1, 2, 4}, + IN_ET, + std::vector{10, 3}, + std::vector{ + // channel 1 + 2, 0, 1, + // channel 2 + 1, 0, 2}, + std::vector{ + // channel 1 + 20, 6, 10, 3, + // channel 2 + 10, 3, 20, 6}, + {1}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 2, 2}, + PartialShape {2, 1, 3}, + PartialShape {1, 1, 4}, + IN_ET, + std::vector{ + // channel 1 + 4, 7, + // channel 2 + 5, 5}, + std::vector{ + // filter 1 + 2, 0, 1, + // filter 2 + 1, 0, 2}, + std::vector{13, 19, 14, 17}, + {1}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {2, 1, 2}, + PartialShape {1, 1, 3}, + PartialShape {2, 1, 4}, + IN_ET, + std::vector{ + // batch 1 + 1, 3, + // batch 2 + 2, 2}, + std::vector{2, 0, 1}, + std::vector{ + // batch 1 + 2, 6, 1, 3, + // batch 2 + 4, 4, 2, 2}, + {1}, + {0}, + {0}, + {1}, + {0}), +// --------------------- 2D ConvolutionBackprop ------------------------------------------ + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{ + 1, 3, + 7, 5}, + std::vector{ + 1, 2, 3, + 0, 1, 0, + 3, 2, 1}, + std::vector{ + 1, 5, 9, 9, + 7, 20, 34, 15, + 3, 18, 12, 3, + 21, 29, 17, 5}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 3, 3}, + IN_ET, + std::vector{ + 1, 3, + 7, 5}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 23, 35, 18, + 23, 19, 8, + 29, 17, 5}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}), + ConvolutionBackpropParams(PartialShape {1, 1, 4, 4}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{ + 1, 3, 5, 7, + 7, 5, 3, 1, + 2, 4, 6, 8, + 8, 6, 4, 2}, + std::vector{ + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + 20, 37, 27, 18, + 22, 40, 60, 52, + 41, 69, 49, 31, + 18, 26, 34, 22}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 5, 5}, + IN_ET, + std::vector{ + 2, 5, + 4, 3}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 2, 4, 11, 10, 15, + 2, 2, 7, 5, 5, + 10, 12, 32, 16, 14, + 4, 4, 7, 3, 3, + 12, 8, 13, 6, 3}, + {2, 2}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 6, 6}, + IN_ET, + std::vector{ + 2, 3, + 4, 3}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 2, 3, 4, 6, 6, 9, + 4, 3, 8, 6, 12, 9, + 2, 3, 2, 3, 2, 3, + 4, 3, 4, 3, 4, 3, + 6, 9, 4, 6, 2, 3, + 12, 9, 8, 6, 4, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {2, 2}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 5, 5}, + IN_ET, + std::vector{ + 1, 3, 5, + 7, 5, 3, + 2, 4, 6}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 23, 0, 43, 0, 29, + 0, 0, 0, 0, 0, + 31, 0, 57, 0, 45, + 0, 0, 0, 0, 0, + 35, 0, 38, 0, 21}, + {2, 2}, + {2, 2}, + {2, 2}, + {2, 2}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 2, 3, 3}, + PartialShape {1, 2, 4, 4}, + IN_ET, + std::vector{ + 1, 3, + 7, 5}, + std::vector{ + // channel 1 + 5, 3, 5, + 1, 3, 1, + 4, 2, 4, + // channel 2 + -5, 3, 5, + 1, -3, 1, + 4, 2, -4}, + std::vector{ + // channel 1 + 5, 18, 14, 15, + 36, 52, 60, 28, + 11, 40, 32, 17, + 28, 34, 38, 20, + // channel 2 + -5, -12, 14, 15, + -34, -4, 42, 28, + 11, -2, -6, -7, + 28, 34, -18, -20}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 2, 2, 2}, + PartialShape {2, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{ + // channel 1 + 1, 3, + 7, 5, + // channel 2 + 2, 4, + 8, 6}, + std::vector{ + // channel 1 + 5, 3, 5, + 1, 3, 1, + 4, 2, 4, + // channel 2 + -5, 3, 5, + 1, -3, 1, + 4, 2, -4}, + std::vector{ + -5, 4, 36, 35, + -2, 44, 108, 62, + 27, 42, 22, 7, + 60, 74, 18, -4}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 2, 1, 1}, + PartialShape {2, 2, 2, 2}, + PartialShape {1, 2, 2, 2}, + IN_ET, + std::vector{ + // channel 1 + 2, + // channel 2 + 3}, + std::vector{ + // batch 0 + // channel 1 + 5, 3, + 1, 3, + // channel 2 + -5, 3, + 1, -3, + // batch 1 + // channel 1 + 5, 3, + 1, 3, + // channel 2 + -5, 3, + 1, -3}, + std::vector{ + 25, 15, 5, 15, -25, 15, 5, -15}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {2, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {2, 1, 4, 4}, + IN_ET, + std::vector{ + // batch 1 + 1, 3, + 1, 3, + // batch 2 + -1, 3, + 1, 3}, + std::vector{ + -5, 3, 5, + 1, -3, 1, + 4, 2, -4}, + std::vector{ + // batch 1 + -5, -12, 14, 15, + -4, -12, 6, 18, + 5, 14, -6, -9, + 4, 14, 2, -12, + // batch 2 + 5, -18, 4, 15, + -6, -6, 4, 18, + -3, 10, 2, -9, + 4, 14, 2, -12}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), +// --------------------- 3D convolution ------------------------------------------ + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2, 2}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {1, 1, 4, 4, 4}, + IN_ET, + std::vector{ + // depth: 1 + 15, 3, + 21, 10, + // depth: 2 + 10, 13, + 11, 17}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 15, 33, 51, 9, + 21, 67, 86, 30, + 30, 42, 43, 6, + 42, 41, 52, 20, + // depth: 2 + 25, 66, 107, 48, + 32, 116, 166, 81, + 50, 89, 93, 32, + 64, 86, 91, 54, + // depth: 3 + 25, 66, 107, 48, + 32, 116, 166, 81, + 50, 89, 93, 32, + 64, 86, 91, 54, + // depth: 4 + 10, 33, 56, 39, + 11, 49, 80, 51, + 20, 47, 50, 26, + 22, 45, 39, 34}, + {1, 1, 1}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2, 2}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {1, 1, 3, 3, 3}, + IN_ET, + std::vector{ + // depth: 1 + 15, 3, + 21, 10, + // depth: 2 + 10, 13, + 11, 17}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 116, 166, 81, + 89, 93, 32, + 86, 91, 54, + // depth: 2 + 116, 166, 81, + 89, 93, 32, + 86, 91, 54, + // depth: 3 + 49, 80, 51, + 47, 50, 26, + 45, 39, 34}, + {1, 1, 1}, + {1, 1, 1}, + {1, 1, 1}, + {1, 1, 1}, + {1, 1, 1}), + ConvolutionBackpropParams(PartialShape {1, 1, 4, 4, 4}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {1, 1, 4, 4, 4}, + IN_ET, + std::vector{ + // depth: 1 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 2 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 3 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 4 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 12, 30, 36, 24, + 26, 42, 42, 30, + 34, 56, 54, 50, + 14, 18, 24, 16, + // depth: 2 + 18, 45, 54, 36, + 39, 63, 63, 45, + 51, 84, 81, 75, + 21, 27, 36, 24, + // depth: 3 + 18, 45, 54, 36, + 39, 63, 63, 45, + 51, 84, 81, 75, + 21, 27, 36, 24, + // depth: 4 + 12, 30, 36, 24, + 26, 42, 42, 30, + 34, 56, 54, 50, + 14, 18, 24, 16}, + {1, 1, 1}, + {1, 1, 1}, + {1, 1, 1}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2, 2}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {1, 1, 5, 5, 5}, + IN_ET, + std::vector{ + // depth: 1 + 15, 3, + 21, 10, + // depth: 2 + 10, 13, + 11, 17}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 15, 30, 48, 6, 9, + 0, 15, 0, 3, 0, + 51, 57, 109, 23, 36, + 0, 21, 0, 10, 0, + 42, 21, 62, 10, 20, + // depth: 2 + 15, 30, 48, 6, 9, + 0, 15, 0, 3, 0, + 51, 57, 109, 23, 36, + 0, 21, 0, 10, 0, + 42, 21, 62, 10, 20, + // depth: 3 + 25, 50, 91, 32, 48, + 0, 25, 0, 16, 0, + 82, 89, 205, 70, 113, + 0, 32, 0, 27, 0, + 64, 32, 118, 27, 54, + // depth: 4 + 10, 20, 43, 26, 39, + 0, 10, 0, 13, 0, + 31, 32, 96, 47, 77, + 0, 11, 0, 17, 0, + 22, 11, 56, 17, 34, + // depth: 5 + 10, 20, 43, 26, 39, + 0, 10, 0, 13, 0, + 31, 32, 96, 47, 77, + 0, 11, 0, 17, 0, + 22, 11, 56, 17, 34}, + {2, 2, 2}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4, 4, 4}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {1, 1, 7, 7, 7}, + IN_ET, + std::vector{ + // depth: 1 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 2 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 3 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 4 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 12, 0, 30, 0, 36, 0, 24, + 0, 0, 0, 0, 0, 0, 0, + 26, 0, 42, 0, 42, 0, 30, + 0, 0, 0, 0, 0, 0, 0, + 34, 0, 56, 0, 54, 0, 50, + 0, 0, 0, 0, 0, 0, 0, + 14, 0, 18, 0, 24, 0, 16, + // depth: 2 + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + // depth: 3 + 18, 0, 45, 0, 54, 0, 36, + 0, 0, 0, 0, 0, 0, 0, + 39, 0, 63, 0, 63, 0, 45, + 0, 0, 0, 0, 0, 0, 0, + 51, 0, 84, 0, 81, 0, 75, + 0, 0, 0, 0, 0, 0, 0, + 21, 0, 27, 0, 36, 0, 24, + // depth: 4 + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + // depth: 5 + 18, 0, 45, 0, 54, 0, 36, + 0, 0, 0, 0, 0, 0, 0, + 39, 0, 63, 0, 63, 0, 45, + 0, 0, 0, 0, 0, 0, 0, + 51, 0, 84, 0, 81, 0, 75, + 0, 0, 0, 0, 0, 0, 0, + 21, 0, 27, 0, 36, 0, 24, + // depth: 6 + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + // depth: 7 + 12, 0, 30, 0, 36, 0, 24, + 0, 0, 0, 0, 0, 0, 0, + 26, 0, 42, 0, 42, 0, 30, + 0, 0, 0, 0, 0, 0, 0, + 34, 0, 56, 0, 54, 0, 50, + 0, 0, 0, 0, 0, 0, 0, + 14, 0, 18, 0, 24, 0, 16}, + {2, 2, 2}, + {2, 2, 2}, + {2, 2, 2}, + {2, 2, 2}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2, 2}, + PartialShape {1, 2, 3, 3, 3}, + PartialShape {1, 2, 4, 4, 4}, + IN_ET, + std::vector{ + // depth: 1 + 1, 8, + 1, 3, + // depth: 2 + 1, 7, + 3, 8}, + std::vector{ + // -- channel 1 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // -- channel 2 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // -- channel 1 -- + // depth: 1 + 1, 10, 19, 24, + 1, 6, 17, 9, + 2, 18, 13, 16, + 2, 7, 5, 6, + // depth: 2 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 3 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 4 + 1, 9, 17, 21, + 3, 15, 32, 24, + 2, 18, 17, 14, + 6, 19, 14, 16, + // -- channel 2 -- + // depth: 1 + 1, 10, 19, 24, + 1, 6, 17, 9, + 2, 18, 13, 16, + 2, 7, 5, 6, + // depth: 2 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 3 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 4 + 1, 9, 17, 21, + 3, 15, 32, 24, + 2, 18, 17, 14, + 6, 19, 14, 16}, + {1, 1, 1}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 2, 2, 2, 2}, + PartialShape {2, 1, 3, 3, 3}, + PartialShape {1, 1, 4, 4, 4}, + IN_ET, + std::vector{ + // -- in 1 -- + // depth: 1 + 1, 3, + 2, 5, + // depth: 2 + 1, 0, + 3, 6, + // -- in 2 -- + // depth: 1 + 1, 3, + 2, 5, + // depth: 2 + 3, 0, + 1, 8}, + std::vector{ + // -- filter 1 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // -- filter 2 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 2, 10, 18, 18, + 4, 20, 38, 30, + 4, 18, 20, 12, + 8, 24, 18, 20, + // depth: 2 + 6, 18, 30, 18, + 8, 46, 78, 72, + 12, 26, 42, 12, + 16, 56, 40, 48, + // depth: 3 + 6, 18, 30, 18, + 8, 46, 78, 72, + 12, 26, 42, 12, + 16, 56, 40, 48, + // depth: 4 + 4, 8, 12, 0, + 4, 26, 40, 42, + 8, 8, 22, 0, + 8, 32, 22, 28}, + {1, 1, 1}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {2, 1, 2, 2, 2}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {2, 1, 4, 4, 4}, + IN_ET, + std::vector{ + // -- batch 1 -- + // depth: 1 + 1, 3, + 2, 5, + // depth: 2 + 1, 0, + 6, 4, + // -- batch 2 -- + // depth: 1 + 1, 5, + 2, 8, + // depth: 2 + 2, 1, + 0, 5}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // -- batch 1 -- + // depth: 1 + 1, 5, 9, 9, + 2, 10, 19, 15, + 2, 9, 10, 6, + 4, 12, 9, 10, + // depth: 2 + 2, 7, 12, 9, + 8, 27, 45, 27, + 4, 16, 16, 6, + 16, 26, 25, 18, + // depth: 3 + 2, 7, 12, 9, + 8, 27, 45, 27, + 4, 16, 16, 6, + 16, 26, 25, 18, + // depth: 4 + 1, 2, 3, 0, + 6, 17, 26, 12, + 2, 7, 6, 0, + 12, 14, 16, 8, + // -- batch 2 -- + // depth: 1 + 1, 7, 13, 15, + 2, 13, 27, 24, + 2, 13, 15, 10, + 4, 18, 12, 16, + // depth: 2 + 3, 12, 21, 18, + 2, 20, 38, 39, + 6, 17, 25, 12, + 4, 28, 17, 26, + // depth: 3 + 3, 12, 21, 18, + 2, 20, 38, 39, + 6, 17, 25, 12, + 4, 28, 17, 26, + // depth: 4 + 2, 5, 8, 3, + 0, 7, 11, 15, + 4, 4, 10, 2, + 0, 10, 5, 10}, + {1, 1, 1}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}) + }; + return convolutionBackpropParams; +} + +template +std::vector generateConvolutionBackpropUintParams() { + using T = typename element_type_traits::value_type; + + std::vector convolutionBackpropParams { +// --------------------- 1D ConvolutionBackprop ------------------------------------------ + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 6}, + IN_ET, + std::vector{5, 6, 7, 2}, + std::vector{2, 0, 1}, + std::vector{10, 12, 19, 10, 7, 2}, + {1}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 4}, + IN_ET, + std::vector{5, 6, 7, 2}, + std::vector{2, 0, 1}, + std::vector{12, 19, 10, 7}, + {1}, + {1}, + {1}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 5}, + IN_ET, + std::vector{5, 7}, + std::vector{2, 0, 1}, + std::vector{10, 0, 19, 0, 7}, + {2}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 5}, + IN_ET, + std::vector{5, 6, 7, 2}, + std::vector{2, 0, 1}, + std::vector{12, 19, 10, 7, 2}, + {1}, + {1}, + {1}, + {1}, + {1}), + ConvolutionBackpropParams(PartialShape {1, 1, 3}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 7}, + IN_ET, + std::vector{8, 5, 1}, + std::vector{2, 0, 1}, + std::vector{16, 10, 2, 0, 8, 5, 1}, + {1}, + {0}, + {0}, + {2}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4}, + PartialShape {1, 1, 3}, + PartialShape {1, 1, 7}, + IN_ET, + std::vector{3, 9, 1, 2}, + std::vector{2, 0, 1}, + std::vector{18, 0, 5, 0, 13, 0, 1}, + {2}, + {2}, + {2}, + {2}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2}, + PartialShape {1, 2, 3}, + PartialShape {1, 2, 4}, + IN_ET, + std::vector{10, 3}, + std::vector{ + // channel 1 + 2, 0, 1, + // channel 2 + 1, 0, 2}, + std::vector{ + // channel 1 + 20, 6, 10, 3, + // channel 2 + 10, 3, 20, 6}, + {1}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {1, 2, 2}, + PartialShape {2, 1, 3}, + PartialShape {1, 1, 4}, + IN_ET, + std::vector{ + // channel 1 + 4, 7, + // channel 2 + 5, 5}, + std::vector{ + // filter 1 + 2, 0, 1, + // filter 2 + 1, 0, 2}, + std::vector{13, 19, 14, 17}, + {1}, + {0}, + {0}, + {1}, + {0}), + ConvolutionBackpropParams(PartialShape {2, 1, 2}, + PartialShape {1, 1, 3}, + PartialShape {2, 1, 4}, + IN_ET, + std::vector{ + // batch 1 + 1, 3, + // batch 2 + 2, 2}, + std::vector{2, 0, 1}, + std::vector{ + // batch 1 + 2, 6, 1, 3, + // batch 2 + 4, 4, 2, 2}, + {1}, + {0}, + {0}, + {1}, + {0}), +// --------------------- 2D ConvolutionBackprop ------------------------------------------ + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{ + 1, 3, + 7, 5}, + std::vector{ + 1, 2, 3, + 0, 1, 0, + 3, 2, 1}, + std::vector{ + 1, 5, 9, 9, + 7, 20, 34, 15, + 3, 18, 12, 3, + 21, 29, 17, 5}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 3, 3}, + IN_ET, + std::vector{ + 1, 3, + 7, 5}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 23, 35, 18, + 23, 19, 8, + 29, 17, 5}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}), + ConvolutionBackpropParams(PartialShape {1, 1, 4, 4}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 4, 4}, + IN_ET, + std::vector{ + 1, 3, 5, 7, + 7, 5, 3, 1, + 2, 4, 6, 8, + 8, 6, 4, 2}, + std::vector{ + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + 20, 37, 27, 18, + 22, 40, 60, 52, + 41, 69, 49, 31, + 18, 26, 34, 22}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 5, 5}, + IN_ET, + std::vector{ + 2, 5, + 4, 3}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 2, 4, 11, 10, 15, + 2, 2, 7, 5, 5, + 10, 12, 32, 16, 14, + 4, 4, 7, 3, 3, + 12, 8, 13, 6, 3}, + {2, 2}, + {0, 0}, + {0, 0}, + {1, 1}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 6, 6}, + IN_ET, + std::vector{ + 2, 3, + 4, 3}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 2, 3, 4, 6, 6, 9, + 4, 3, 8, 6, 12, 9, + 2, 3, 2, 3, 2, 3, + 4, 3, 4, 3, 4, 3, + 6, 9, 4, 6, 2, 3, + 12, 9, 8, 6, 4, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {2, 2}, + {0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 3, 3}, + PartialShape {1, 1, 5, 5}, + IN_ET, + std::vector{ + 1, 3, 5, + 7, 5, 3, + 2, 4, 6}, + std::vector{ + 1, 2, 3, + 1, 1, 1, + 3, 2, 1}, + std::vector{ + 23, 0, 43, 0, 29, + 0, 0, 0, 0, 0, + 31, 0, 57, 0, 45, + 0, 0, 0, 0, 0, + 35, 0, 38, 0, 21}, + {2, 2}, + {2, 2}, + {2, 2}, + {2, 2}, + {0, 0}), +// --------------------- 3D convolution ------------------------------------------ + ConvolutionBackpropParams(PartialShape {1, 1, 4, 4, 4}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {1, 1, 4, 4, 4}, + IN_ET, + std::vector{ + // depth: 1 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 2 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 3 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 4 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 12, 30, 36, 24, + 26, 42, 42, 30, + 34, 56, 54, 50, + 14, 18, 24, 16, + // depth: 2 + 18, 45, 54, 36, + 39, 63, 63, 45, + 51, 84, 81, 75, + 21, 27, 36, 24, + // depth: 3 + 18, 45, 54, 36, + 39, 63, 63, 45, + 51, 84, 81, 75, + 21, 27, 36, 24, + // depth: 4 + 12, 30, 36, 24, + 26, 42, 42, 30, + 34, 56, 54, 50, + 14, 18, 24, 16}, + {1, 1, 1}, + {1, 1, 1}, + {1, 1, 1}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 4, 4, 4}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {1, 1, 7, 7, 7}, + IN_ET, + std::vector{ + // depth: 1 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 2 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 3 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3, + // depth: 4 + 1, 3, 2, 1, + 1, 3, 3, 1, + 2, 1, 1, 3, + 3, 2, 3, 3}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 12, 0, 30, 0, 36, 0, 24, + 0, 0, 0, 0, 0, 0, 0, + 26, 0, 42, 0, 42, 0, 30, + 0, 0, 0, 0, 0, 0, 0, + 34, 0, 56, 0, 54, 0, 50, + 0, 0, 0, 0, 0, 0, 0, + 14, 0, 18, 0, 24, 0, 16, + // depth: 2 + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + // depth: 3 + 18, 0, 45, 0, 54, 0, 36, + 0, 0, 0, 0, 0, 0, 0, + 39, 0, 63, 0, 63, 0, 45, + 0, 0, 0, 0, 0, 0, 0, + 51, 0, 84, 0, 81, 0, 75, + 0, 0, 0, 0, 0, 0, 0, + 21, 0, 27, 0, 36, 0, 24, + // depth: 4 + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + // depth: 5 + 18, 0, 45, 0, 54, 0, 36, + 0, 0, 0, 0, 0, 0, 0, + 39, 0, 63, 0, 63, 0, 45, + 0, 0, 0, 0, 0, 0, 0, + 51, 0, 84, 0, 81, 0, 75, + 0, 0, 0, 0, 0, 0, 0, + 21, 0, 27, 0, 36, 0, 24, + // depth: 6 + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + // depth: 7 + 12, 0, 30, 0, 36, 0, 24, + 0, 0, 0, 0, 0, 0, 0, + 26, 0, 42, 0, 42, 0, 30, + 0, 0, 0, 0, 0, 0, 0, + 34, 0, 56, 0, 54, 0, 50, + 0, 0, 0, 0, 0, 0, 0, + 14, 0, 18, 0, 24, 0, 16}, + {2, 2, 2}, + {2, 2, 2}, + {2, 2, 2}, + {2, 2, 2}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 1, 2, 2, 2}, + PartialShape {1, 2, 3, 3, 3}, + PartialShape {1, 2, 4, 4, 4}, + IN_ET, + std::vector{ + // depth: 1 + 1, 8, + 1, 3, + // depth: 2 + 1, 7, + 3, 8}, + std::vector{ + // -- channel 1 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // -- channel 2 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // -- channel 1 -- + // depth: 1 + 1, 10, 19, 24, + 1, 6, 17, 9, + 2, 18, 13, 16, + 2, 7, 5, 6, + // depth: 2 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 3 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 4 + 1, 9, 17, 21, + 3, 15, 32, 24, + 2, 18, 17, 14, + 6, 19, 14, 16, + // -- channel 2 -- + // depth: 1 + 1, 10, 19, 24, + 1, 6, 17, 9, + 2, 18, 13, 16, + 2, 7, 5, 6, + // depth: 2 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 3 + 2, 19, 36, 45, + 4, 21, 49, 33, + 4, 36, 30, 30, + 8, 26, 19, 22, + // depth: 4 + 1, 9, 17, 21, + 3, 15, 32, 24, + 2, 18, 17, 14, + 6, 19, 14, 16}, + {1, 1, 1}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {1, 2, 2, 2, 2}, + PartialShape {2, 1, 3, 3, 3}, + PartialShape {1, 1, 4, 4, 4}, + IN_ET, + std::vector{ + // -- in 1 -- + // depth: 1 + 1, 3, + 2, 5, + // depth: 2 + 1, 0, + 3, 6, + // -- in 2 -- + // depth: 1 + 1, 3, + 2, 5, + // depth: 2 + 3, 0, + 1, 8}, + std::vector{ + // -- filter 1 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // -- filter 2 -- + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // depth: 1 + 2, 10, 18, 18, + 4, 20, 38, 30, + 4, 18, 20, 12, + 8, 24, 18, 20, + // depth: 2 + 6, 18, 30, 18, + 8, 46, 78, 72, + 12, 26, 42, 12, + 16, 56, 40, 48, + // depth: 3 + 6, 18, 30, 18, + 8, 46, 78, 72, + 12, 26, 42, 12, + 16, 56, 40, 48, + // depth: 4 + 4, 8, 12, 0, + 4, 26, 40, 42, + 8, 8, 22, 0, + 8, 32, 22, 28}, + {1, 1, 1}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}), + ConvolutionBackpropParams(PartialShape {2, 1, 2, 2, 2}, + PartialShape {1, 1, 3, 3, 3}, + PartialShape {2, 1, 4, 4, 4}, + IN_ET, + std::vector{ + // -- batch 1 -- + // depth: 1 + 1, 3, + 2, 5, + // depth: 2 + 1, 0, + 6, 4, + // -- batch 2 -- + // depth: 1 + 1, 5, + 2, 8, + // depth: 2 + 2, 1, + 0, 5}, + std::vector{ + // depth: 1 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 2 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2, + // depth: 3 + 1, 2, 3, + 0, 1, 0, + 2, 1, 2}, + std::vector{ + // -- batch 1 -- + // depth: 1 + 1, 5, 9, 9, + 2, 10, 19, 15, + 2, 9, 10, 6, + 4, 12, 9, 10, + // depth: 2 + 2, 7, 12, 9, + 8, 27, 45, 27, + 4, 16, 16, 6, + 16, 26, 25, 18, + // depth: 3 + 2, 7, 12, 9, + 8, 27, 45, 27, + 4, 16, 16, 6, + 16, 26, 25, 18, + // depth: 4 + 1, 2, 3, 0, + 6, 17, 26, 12, + 2, 7, 6, 0, + 12, 14, 16, 8, + // -- batch 2 -- + // depth: 1 + 1, 7, 13, 15, + 2, 13, 27, 24, + 2, 13, 15, 10, + 4, 18, 12, 16, + // depth: 2 + 3, 12, 21, 18, + 2, 20, 38, 39, + 6, 17, 25, 12, + 4, 28, 17, 26, + // depth: 3 + 3, 12, 21, 18, + 2, 20, 38, 39, + 6, 17, 25, 12, + 4, 28, 17, 26, + // depth: 4 + 2, 5, 8, 3, + 0, 7, 11, 15, + 4, 4, 10, 2, + 0, 10, 5, 10}, + {1, 1, 1}, + {0, 0, 0}, + {0, 0, 0}, + {1, 1, 1}, + {0, 0, 0}) + }; + return convolutionBackpropParams; +} + +std::vector generateConvolutionBackpropCombinedParams() { + const std::vector> convolutionBackpropTypeParams { + generateConvolutionBackpropFloatParams(), + generateConvolutionBackpropFloatParams(), + generateConvolutionBackpropFloatParams(), + generateConvolutionBackpropFloatParams(), + generateConvolutionBackpropFloatParams(), + generateConvolutionBackpropFloatParams(), + generateConvolutionBackpropFloatParams(), + generateConvolutionBackpropUintParams(), + generateConvolutionBackpropUintParams(), + generateConvolutionBackpropUintParams(), + generateConvolutionBackpropUintParams(), + generateConvolutionBackpropUintParams(), + }; + std::vector combinedParams; + + for (const auto& params : convolutionBackpropTypeParams) { + combinedParams.insert(combinedParams.end(), params.begin(), params.end()); + } + return combinedParams; +} + +INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackprop_With_Hardcoded_Refs, ReferenceConvolutionBackpropLayerTest, + testing::ValuesIn(generateConvolutionBackpropCombinedParams()), ReferenceConvolutionBackpropLayerTest::getTestCaseName); + +} // namespace \ No newline at end of file diff --git a/docs/template_plugin/tests/functional/op_reference/slice.cpp b/docs/template_plugin/tests/functional/op_reference/slice.cpp new file mode 100644 index 00000000000..60ffb7a8af5 --- /dev/null +++ b/docs/template_plugin/tests/functional/op_reference/slice.cpp @@ -0,0 +1,447 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include + +#include "base_reference_test.hpp" +#include "openvino/opsets/opset8.hpp" + +using namespace ov; + +namespace reference_tests { +namespace { +struct SliceParams { + SliceParams(const Tensor& data, + const Tensor& start, + const Tensor& stop, + const Tensor& step, + const Tensor& axes, + const Tensor& output, + const std::string& test_name = "") + : m_data(data), + m_start(start), + m_stop(stop), + m_step(step), + m_axes(axes), + m_output(output), + m_test_name(test_name), + m_default_axes(false) {} + + // Default `axes` input + SliceParams(const Tensor& data, + const Tensor& start, + const Tensor& stop, + const Tensor& step, + const Tensor& output, + const std::string& test_name = "") + : m_data(data), + m_start(start), + m_stop(stop), + m_step(step), + m_output(output), + m_test_name(test_name), + m_default_axes(true) {} + + Tensor m_data; + Tensor m_start; + Tensor m_stop; + Tensor m_step; + Tensor m_axes; + Tensor m_output; + std::string m_test_name; + bool m_default_axes = false; +}; + +class ReferenceSliceLayerTest : public testing::TestWithParam, public CommonReferenceTest { +public: + void SetUp() override { + auto params = GetParam(); + if (params.m_default_axes) { + function = CreateFunction(params.m_data, params.m_start, params.m_stop, params.m_step); + inputData = {params.m_data.data, params.m_start.data, params.m_stop.data, params.m_step.data}; + + } else { + function = CreateFunction(params.m_data, params.m_start, params.m_stop, params.m_step, params.m_axes); + inputData = {params.m_data.data, + params.m_start.data, + params.m_stop.data, + params.m_step.data, + params.m_axes.data}; + } + + refOutData = {params.m_output.data}; + } + static std::string getTestCaseName(const testing::TestParamInfo& obj) { + auto param = obj.param; + std::ostringstream result; + result << "test_name=" << param.m_test_name << "__"; + result << "data_shape=" << param.m_data.shape << "_"; + result << "data_type=" << param.m_data.type << "_"; + result << "ind_type=" << param.m_start.type << "_"; + if (param.m_default_axes) { + result << "axes_shape=" + << "default" + << "_"; + result << "axes_type=" + << "default" + << "_"; + } else { + result << "axes_shape=" << param.m_axes.shape << "_"; + result << "axes_type=" << param.m_axes.type << "_"; + } + + return result.str(); + } + +private: + static std::shared_ptr CreateFunction(const Tensor& data, + const Tensor& start, + const Tensor& stop, + const Tensor& step, + const Tensor& axes) { + const auto data_param = std::make_shared(data.type, data.shape); + const auto start_param = std::make_shared(start.type, start.shape); + const auto stop_param = std::make_shared(stop.type, stop.shape); + const auto step_param = std::make_shared(step.type, step.shape); + const auto axes_param = std::make_shared(axes.type, axes.shape); + + const auto slice = std::make_shared(data_param, start_param, stop_param, step_param, axes_param); + return std::make_shared(NodeVector{slice}, + ParameterVector{data_param, start_param, stop_param, step_param, axes_param}); + } + + // Default `axes` input + static std::shared_ptr CreateFunction(const Tensor& data, + const Tensor& start, + const Tensor& stop, + const Tensor& step) { + const auto data_param = std::make_shared(data.type, data.shape); + const auto start_param = std::make_shared(start.type, start.shape); + const auto stop_param = std::make_shared(stop.type, stop.shape); + const auto step_param = std::make_shared(step.type, step.shape); + + const auto slice = std::make_shared(data_param, start_param, stop_param, step_param); + return std::make_shared(NodeVector{slice}, + ParameterVector{data_param, start_param, stop_param, step_param}); + } +}; + +TEST_P(ReferenceSliceLayerTest, CompareWithHardcodedRefs) { + Exec(); +} + +} // namespace + +template +std::vector generateSliceParamsUnsigned() { + using DATA_T = typename element_type_traits::value_type; + using IND_T = typename element_type_traits::value_type; + using AXIS_T = typename element_type_traits::value_type; + + std::vector test_params{ + SliceParams(Tensor{{4}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{1}, IND_ET, std::vector{0}}, + Tensor{{1}, IND_ET, std::vector{5}}, + Tensor{{1}, IND_ET, std::vector{1}}, + Tensor{{1}, AXIS_ET, std::vector{0}}, + Tensor{{4}, DATA_ET, std::vector{1, 2, 3, 4}}, + "1D_full_axes"), + SliceParams(Tensor{{4}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{1}, IND_ET, std::vector{0}}, + Tensor{{1}, IND_ET, std::vector{5}}, + Tensor{{1}, IND_ET, std::vector{1}}, + Tensor{{4}, DATA_ET, std::vector{1, 2, 3, 4}}, + "1D_default_axes"), + SliceParams(Tensor{{4}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{1}, IND_ET, std::vector{6}}, + Tensor{{1}, IND_ET, std::vector{5}}, + Tensor{{1}, IND_ET, std::vector{1}}, + Tensor{{1}, AXIS_ET, std::vector{0}}, + Tensor{{0}, DATA_ET, std::vector{}}, + "1D_empty_output"), + SliceParams(Tensor{{2, 2}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{2}, IND_ET, std::vector{0, 0}}, + Tensor{{2}, IND_ET, std::vector{2, 2}}, + Tensor{{2}, IND_ET, std::vector{1, 1}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{2, 2}, DATA_ET, std::vector{1, 2, 3, 4}}, + "2D_full_axes"), + SliceParams(Tensor{{2, 2}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{2}, IND_ET, std::vector{0, 0}}, + Tensor{{2}, IND_ET, std::vector{2, 2}}, + Tensor{{2}, IND_ET, std::vector{1, 1}}, + Tensor{{2, 2}, DATA_ET, std::vector{1, 2, 3, 4}}, + "2D_default_axes"), + SliceParams(Tensor{{2, 4}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + Tensor{{2}, IND_ET, std::vector{1, 0}}, + Tensor{{2}, IND_ET, std::vector{2, 3}}, + Tensor{{2}, IND_ET, std::vector{1, 2}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{1, 2}, DATA_ET, std::vector{5, 7}}, + "2D_step_2"), + SliceParams(Tensor{{3, 16}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{2}, IND_ET, std::vector{0, 0}}, + Tensor{{2}, IND_ET, std::vector{3, 16}}, + Tensor{{2}, IND_ET, std::vector{1, 15}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{3, 2}, DATA_ET, std::vector{0, 15, 16, 31, 32, 47}}, + "2D_big_step"), + SliceParams(Tensor{{2, 2}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{2}, IND_ET, std::vector{10, 0}}, + Tensor{{2}, IND_ET, std::vector{20, 2}}, + Tensor{{2}, IND_ET, std::vector{1, 1}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{0, 2}, DATA_ET, std::vector{}}, + "2D_empty_output"), + SliceParams(Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + Tensor{{3}, IND_ET, std::vector{0, 0, 0}}, + Tensor{{3}, IND_ET, std::vector{2, 2, 2}}, + Tensor{{3}, IND_ET, std::vector{1, 1, 1}}, + Tensor{{3}, AXIS_ET, std::vector{0, 1, 2}}, + Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + "3D_full_axes"), + SliceParams(Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + Tensor{{3}, IND_ET, std::vector{0, 0, 0}}, + Tensor{{3}, IND_ET, std::vector{2, 2, 2}}, + Tensor{{3}, IND_ET, std::vector{1, 1, 1}}, + Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + "3D_default_axes"), + SliceParams(Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + Tensor{{2}, IND_ET, std::vector{0, 0}}, + Tensor{{2}, IND_ET, std::vector{2, 2}}, + Tensor{{2}, IND_ET, std::vector{1, 1}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + "3D_less_axes"), + SliceParams(Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + Tensor{{3}, IND_ET, std::vector{0, 2, 0}}, + Tensor{{3}, IND_ET, std::vector{2, 2, 2}}, + Tensor{{3}, IND_ET, std::vector{1, 1, 1}}, + Tensor{{3}, AXIS_ET, std::vector{0, 1, 2}}, + Tensor{{2, 0, 2}, DATA_ET, std::vector{}}, + "3D_empty_output"), + SliceParams(Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{4}, IND_ET, std::vector{0, 0, 0, 0}}, + Tensor{{4}, IND_ET, std::vector{4, 2, 3, 2}}, + Tensor{{4}, IND_ET, std::vector{1, 1, 1, 1}}, + Tensor{{4}, AXIS_ET, std::vector{0, 1, 2, 3}}, + Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + "4D_full_axes"), + SliceParams(Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{4}, IND_ET, std::vector{0, 0, 0, 0}}, + Tensor{{4}, IND_ET, std::vector{4, 2, 3, 2}}, + Tensor{{4}, IND_ET, std::vector{1, 1, 1, 1}}, + Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + "4D_default_axes"), + SliceParams(Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{1}, IND_ET, std::vector{0}}, + Tensor{{1}, IND_ET, std::vector{2}}, + Tensor{{1}, IND_ET, std::vector{1}}, + Tensor{{1}, AXIS_ET, std::vector{0}}, + Tensor{{2, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}}, + "4D_half_dim"), + SliceParams(Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{1}, IND_ET, std::vector{0}}, + Tensor{{1}, IND_ET, std::vector{4}}, + Tensor{{1}, IND_ET, std::vector{2}}, + Tensor{{1}, AXIS_ET, std::vector{0}}, + Tensor{{2, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}}, + "4D_half_dim_step"), + SliceParams( + Tensor{{2, 4, 2, 2, 3}, + DATA_ET, + std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}}, + Tensor{{5}, IND_ET, std::vector{0, 0, 0, 0, 0}}, + Tensor{{5}, IND_ET, std::vector{2, 4, 2, 2, 3}}, + Tensor{{5}, IND_ET, std::vector{1, 1, 1, 1, 1}}, + Tensor{{5}, AXIS_ET, std::vector{0, 1, 2, 3, 4}}, + Tensor{{2, 2, 2, 1, 2}, + DATA_ET, + std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}}, + "5D_full_axes"), + }; + return test_params; +} + +template +std::vector generateSliceParams() { + using DATA_T = typename element_type_traits::value_type; + using IND_T = typename element_type_traits::value_type; + using AXIS_T = typename element_type_traits::value_type; + + std::vector test_params{ + SliceParams(Tensor{{4}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{1}, IND_ET, std::vector{5}}, + Tensor{{1}, IND_ET, std::vector{-6}}, + Tensor{{1}, IND_ET, std::vector{-1}}, + Tensor{{4}, DATA_ET, std::vector{4, 3, 2, 1}}, + "1D_negative_step"), + SliceParams(Tensor{{4}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{1}, IND_ET, std::vector{0}}, + Tensor{{1}, IND_ET, std::vector{5}}, + Tensor{{1}, IND_ET, std::vector{-1}}, + Tensor{{1}, AXIS_ET, std::vector{0}}, + Tensor{{0}, DATA_ET, std::vector{}}, + "1D_empty_output_negative_step"), + SliceParams(Tensor{{2, 2}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{2}, IND_ET, std::vector{0, 3}}, + Tensor{{2}, IND_ET, std::vector{2, -4}}, + Tensor{{2}, IND_ET, std::vector{1, -1}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{2, 2}, DATA_ET, std::vector{2, 1, 4, 3}}, + "2D_negative_step_mix"), + SliceParams(Tensor{{2, 2}, DATA_ET, std::vector{1, 2, 3, 4}}, + Tensor{{2}, IND_ET, std::vector{-1, 3}}, + Tensor{{2}, IND_ET, std::vector{-4, -4}}, + Tensor{{2}, IND_ET, std::vector{-1, -1}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{2, 2}, DATA_ET, std::vector{4, 3, 2, 1}}, + "2D_negative_step_only"), + SliceParams(Tensor{{3, 16}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{2}, IND_ET, std::vector{2, 15}}, + Tensor{{2}, IND_ET, std::vector{-4, -17}}, + Tensor{{2}, IND_ET, std::vector{-1, -15}}, + Tensor{{2}, AXIS_ET, std::vector{0, 1}}, + Tensor{{3, 2}, DATA_ET, std::vector{47, 32, 31, 16, 15, 0}}, + "2D_negative_big_step"), + SliceParams(Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + Tensor{{3}, IND_ET, std::vector{0, 0, 0}}, + Tensor{{3}, IND_ET, std::vector{2, 2, 2}}, + Tensor{{3}, IND_ET, std::vector{1, 1, 1}}, + Tensor{{3}, AXIS_ET, std::vector{-3, -2, -1}}, + Tensor{{2, 2, 2}, DATA_ET, std::vector{1, 2, 3, 4, 5, 6, 7, 8}}, + "3D_negative_axes"), + SliceParams(Tensor{{2, 4, 3}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}}, + Tensor{{3}, IND_ET, std::vector{0, 0, 4}}, + Tensor{{3}, IND_ET, std::vector{2, 4, -5}}, + Tensor{{3}, IND_ET, std::vector{3, 2, -2}}, + Tensor{{3}, AXIS_ET, std::vector{0, 1, 2}}, + Tensor{{1, 2, 2}, DATA_ET, std::vector{2, 0, 8, 6}}, + "3D_mixed_step"), + SliceParams(Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{4}, + IND_ET, + std::vector{std::numeric_limits::min(), + std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::min()}}, + Tensor{{4}, + IND_ET, + std::vector{std::numeric_limits::max(), + std::numeric_limits::min(), + std::numeric_limits::min(), + std::numeric_limits::max()}}, + Tensor{{4}, IND_ET, std::vector{1, -1, -1, 1}}, + Tensor{{4}, AXIS_ET, std::vector{0, 1, 2, 3}}, + Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1, + 22, 23, 20, 21, 18, 19, 16, 17, 14, 15, 12, 13, + 34, 35, 32, 33, 30, 31, 28, 29, 26, 27, 24, 25, + 46, 47, 44, 45, 42, 43, 40, 41, 38, 39, 36, 37}}, + "4D_INT_MIN_MAX_index"), + SliceParams(Tensor{{4, 2, 3, 2}, DATA_ET, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}}, + Tensor{{2}, IND_ET, std::vector{100, -100}}, + Tensor{{2}, IND_ET, std::vector{-100, 100}}, + Tensor{{2}, IND_ET, std::vector{-1, 2}}, + Tensor{{2}, AXIS_ET, std::vector{2, 0}}, + Tensor{{2, 2, 3, 2}, DATA_ET, std::vector{4, 5, 2, 3, 0, 1, 10, 11, 8, 9, 6, 7, + 28, 29, 26, 27, 24, 25, 34, 35, 32, 33, 30, 31}}, + "4D_mixed"), + SliceParams( + Tensor{{2, 4, 2, 2, 3}, + DATA_ET, + std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}}, + Tensor{{5}, IND_ET, std::vector{0, 1, -5, 100, 1}}, + Tensor{{5}, IND_ET, std::vector{2, 6, 3, -100, 2}}, + Tensor{{5}, IND_ET, std::vector{1, 2, 2, -1, 1}}, + Tensor{{5}, AXIS_ET, std::vector{-5, 1, 4, 2, 3}}, + Tensor{{2, 2, 2, 1, 2}, + DATA_ET, + std::vector{21, 23, 15, 17, 45, 47, 39, 41, 69, 71, 63, 65, 93, 95, 87, 89}}, + "5D_mixed"), + }; + const auto& unsigned_test_params = generateSliceParamsUnsigned(); + test_params.insert(test_params.end(), unsigned_test_params.begin(), unsigned_test_params.end()); + return test_params; +} + +std::vector generateSliceCombinedParams() { + const std::vector> opTypeParams{ + // Mixed types + generateSliceParams(), + generateSliceParams(), + generateSliceParams(), + generateSliceParams(), + generateSliceParams(), + generateSliceParams(), + generateSliceParams(), + generateSliceParams(), + + // Unsigned types + generateSliceParamsUnsigned(), + generateSliceParamsUnsigned(), + generateSliceParamsUnsigned(), + generateSliceParamsUnsigned(), + generateSliceParamsUnsigned(), + generateSliceParamsUnsigned(), + }; + std::vector combinedParams; + std::for_each(opTypeParams.begin(), opTypeParams.end(), [&](std::vector params) { + combinedParams.insert(combinedParams.end(), params.begin(), params.end()); + }); + return combinedParams; +} + +INSTANTIATE_TEST_SUITE_P(smoke_Slice_With_Hardcoded_Refs, + ReferenceSliceLayerTest, + ::testing::ValuesIn(generateSliceCombinedParams()), + ReferenceSliceLayerTest::getTestCaseName); + +} // namespace reference_tests diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/exec_graph_info.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/exec_graph_info.cpp deleted file mode 100644 index 597e029fc5b..00000000000 --- a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/exec_graph_info.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2018-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "behavior/exec_graph_info.hpp" - -using namespace BehaviorTestsDefinitions; - -namespace { - -const std::vector netPrecisions = { - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::FP16 -}; - -const std::vector> configs = { - {} -}; - -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, ExecGraphTests, - ::testing::Combine( - ::testing::ValuesIn(netPrecisions), - ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE), - ::testing::ValuesIn(configs)), - ExecGraphTests::getTestCaseName); - -} // namespace \ No newline at end of file diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/executable_network/exec_network_base.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/executable_network/exec_network_base.cpp new file mode 100644 index 00000000000..e36a6c90a12 --- /dev/null +++ b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/executable_network/exec_network_base.cpp @@ -0,0 +1,34 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include "behavior/executable_network/exec_network_base.hpp" + +using namespace BehaviorTestsDefinitions; + +namespace { +const std::vector> configs = { + {} +}; + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, ExecutableNetworkBaseTest, + ::testing::Combine( + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE), + ::testing::ValuesIn(configs)), + ExecutableNetworkBaseTest::getTestCaseName); + + +const std::vector netPrecisions = { + InferenceEngine::Precision::FP32, + InferenceEngine::Precision::FP16 +}; + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, ExecNetSetPrecision, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE), + ::testing::ValuesIn(configs)), + ExecNetSetPrecision::getTestCaseName); +} // namespace \ No newline at end of file diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/executable_network/get_metric.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/executable_network/get_metric.cpp new file mode 100644 index 00000000000..c36cd07ca93 --- /dev/null +++ b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/executable_network/get_metric.cpp @@ -0,0 +1,72 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include +#include +#include + +#include "behavior/executable_network/get_metric.hpp" + +using namespace BehaviorTestsDefinitions; + +namespace { +// +// Executable Network GetMetric +// + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_SUPPORTED_CONFIG_KEYS, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE, "MULTI:TEMPLATE", "HETERO:TEMPLATE")); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_SUPPORTED_METRICS, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE, "MULTI:TEMPLATE", "HETERO:TEMPLATE")); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_NETWORK_NAME, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE, "MULTI:TEMPLATE", "HETERO:TEMPLATE")); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_OPTIMAL_NUMBER_OF_INFER_REQUESTS, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE, "MULTI:TEMPLATE", "HETERO:TEMPLATE")); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassExecutableNetworkGetMetricTest_ThrowsUnsupported, IEClassExecutableNetworkGetMetricTest, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE, "MULTI:TEMPLATE", "HETERO:TEMPLATE")); +// +// Executable Network GetConfig / SetConfig +// + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassExecutableNetworkGetConfigTest, IEClassExecutableNetworkGetConfigTest, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassExecutableNetworkSetConfigTest, IEClassExecutableNetworkSetConfigTest, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)); + +// +// Hetero Executable Network GetMetric +// + +#ifdef ENABLE_MKL_DNN + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassHeteroExecutableNetworlGetMetricTest, IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_CONFIG_KEYS, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassHeteroExecutableNetworlGetMetricTest, IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassHeteroExecutableNetworlGetMetricTest, IEClassHeteroExecutableNetworkGetMetricTest_NETWORK_NAME, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassHeteroExecutableNetworlGetMetricTest, IEClassHeteroExecutableNetworkGetMetricTest_TARGET_FALLBACK, + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)); + +#endif // ENABLE_MKL_DNN +} // namespace diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/infer_request_dynamic.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/infer_request_dynamic.cpp index df9bc757088..edfdfa24af4 100644 --- a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/infer_request_dynamic.cpp +++ b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/infer_request_dynamic.cpp @@ -14,6 +14,9 @@ const std::vector> configs = { {} }; +const std::vector> HeteroConfigs = { + {{"TARGET_FALLBACK", CommonTestUtils::DEVICE_TEMPLATE}}}; + INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, InferRequestDynamicTests, ::testing::Combine( ::testing::Values(ngraph::builder::subgraph::makeSplitConvConcat()), @@ -23,4 +26,13 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, InferRequestDynamicTests, ::testing::ValuesIn(configs)), InferRequestDynamicTests::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, InferRequestDynamicTests, + ::testing::Combine( + ::testing::Values(ngraph::builder::subgraph::makeSplitConvConcat()), + ::testing::Values(std::vector, std::vector>>{{{1, 4, 20, 20}, {1, 10, 18, 18}}, + {{2, 4, 20, 20}, {2, 10, 18, 18}}}), + ::testing::Values(CommonTestUtils::DEVICE_HETERO), + ::testing::ValuesIn(HeteroConfigs)), + InferRequestDynamicTests::getTestCaseName); + } // namespace diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/inference_chaining.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/inference_chaining.cpp index 6733b507c4f..00e6da05b86 100644 --- a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/inference_chaining.cpp +++ b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/infer_request/inference_chaining.cpp @@ -5,7 +5,7 @@ #include "behavior/infer_request/inference_chaining.hpp" #include "common_test_utils/test_constants.hpp" -using namespace ov::test; +using namespace ov::test::behavior; namespace { @@ -13,11 +13,19 @@ const std::vector> configs = { {} }; +const std::vector> HeteroConfigs = { + {{"TARGET_FALLBACK", CommonTestUtils::DEVICE_TEMPLATE}}}; + INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, OVInferenceChaining, ::testing::Combine( - ::testing::Values(ov::element::f32), ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE), ::testing::ValuesIn(configs)), OVInferenceChaining::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, OVInferenceChaining, + ::testing::Combine( + ::testing::Values(CommonTestUtils::DEVICE_HETERO), + ::testing::ValuesIn(HeteroConfigs)), + OVInferenceChaining::getTestCaseName); + } // namespace diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/ov_exec_network.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/ov_exec_network.cpp deleted file mode 100644 index 0dadbf98b3c..00000000000 --- a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/ov_exec_network.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2018-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "behavior/ov_exec_network.hpp" -#include - -#include "ie_plugin_config.hpp" - -using namespace ov::test; -namespace { -const std::vector netPrecisions = { - ov::element::i8, - ov::element::i16, - ov::element::i32, - ov::element::i64, - ov::element::u8, - ov::element::u16, - ov::element::u32, - ov::element::u64, - ov::element::f16, - ov::element::f32, - }; - -const std::vector> configs = { - {}, -}; -const std::vector> multiConfigs = { - {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, CommonTestUtils::DEVICE_TEMPLATE}}}; - -const std::vector> heteroConfigs = { - {{"TARGET_FALLBACK", CommonTestUtils::DEVICE_TEMPLATE}}}; - -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, - OVExecNetwork, - ::testing::Combine(::testing::ValuesIn(netPrecisions), - ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE), - ::testing::ValuesIn(configs)), - OVExecNetwork::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests, - OVExecNetwork, - ::testing::Combine(::testing::ValuesIn(netPrecisions), - ::testing::Values(CommonTestUtils::DEVICE_MULTI), - ::testing::ValuesIn(multiConfigs)), - OVExecNetwork::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, - OVExecNetwork, - ::testing::Combine(::testing::ValuesIn(netPrecisions), - ::testing::Values(CommonTestUtils::DEVICE_AUTO), - ::testing::ValuesIn(multiConfigs)), - OVExecNetwork::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, - OVExecNetwork, - ::testing::Combine(::testing::ValuesIn(netPrecisions), - ::testing::Values(CommonTestUtils::DEVICE_HETERO), - ::testing::ValuesIn(heteroConfigs)), - OVExecNetwork::getTestCaseName); - -} // namespace diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/ov_executable_network/exec_graph_info.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/ov_executable_network/exec_graph_info.cpp new file mode 100644 index 00000000000..73f232fe282 --- /dev/null +++ b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/ov_executable_network/exec_graph_info.cpp @@ -0,0 +1,55 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#include "behavior/ov_executable_network/exec_graph_info.hpp" + +#include "ie_plugin_config.hpp" +#include + +using namespace ov::test::behavior; +namespace { +const std::vector netPrecisions = { + ov::element::i8, + ov::element::i16, + ov::element::i32, + ov::element::i64, + ov::element::u8, + ov::element::u16, + ov::element::u32, + ov::element::u64, + ov::element::f16, + ov::element::f32, +}; +const std::vector> configs = { + {}, +}; +const std::vector> multiConfigs = { + {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, CommonTestUtils::DEVICE_TEMPLATE}}}; + +const std::vector> heteroConfigs = { + {{"TARGET_FALLBACK", CommonTestUtils::DEVICE_TEMPLATE}}}; + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + OVExecGraphImportExportTest, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE), + ::testing::ValuesIn(configs)), + OVExecGraphImportExportTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, + OVExecGraphImportExportTest, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(multiConfigs)), + OVExecGraphImportExportTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + OVExecGraphImportExportTest, + ::testing::Combine(::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_HETERO), + ::testing::ValuesIn(heteroConfigs)), + OVExecGraphImportExportTest::getTestCaseName); + +} // namespace \ No newline at end of file diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/config.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/plugin/configuration_tests.cpp similarity index 60% rename from docs/template_plugin/tests/functional/shared_tests_instances/behavior/config.cpp rename to docs/template_plugin/tests/functional/shared_tests_instances/behavior/plugin/configuration_tests.cpp index 34e0eb46eac..678534a12e6 100644 --- a/docs/template_plugin/tests/functional/shared_tests_instances/behavior/config.cpp +++ b/docs/template_plugin/tests/functional/shared_tests_instances/behavior/plugin/configuration_tests.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "behavior/config.hpp" +#include "behavior/plugin/configuration_tests.hpp" #include