// SPDX-License-Identifier: Apache-2.0
//
-#include <vector>
#include "single_layer_tests/eltwise.hpp"
#include "common_test_utils/test_constants.hpp"
+#include "common/myriad_common_test_utils.hpp"
+#include <vpu/private_plugin_config.hpp>
+
+#include <vector>
using namespace LayerTestsDefinitions;
using namespace LayerTestsDefinitions::EltwiseParams;
namespace {
+
+typedef std::map<std::string, std::string> Config;
+
std::vector<std::vector<std::vector<size_t>>> inShapes = {
{{2}},
{{1, 1, 1, 3}},
{{1, 2, 4}},
{{1, 4, 4}},
{{1, 4, 4, 1}},
+ {{16, 16, 96}, {96}},
+ {{52, 1, 52, 3, 2}, {2}}
};
std::vector<InferenceEngine::Precision> netPrecisions = {
ngraph::helpers::EltwiseTypes::ADD
};
-std::map<std::string, std::string> additional_config = {};
+Config getConfig() {
+ Config config;
+ config[VPU_CONFIG_KEY(DETECT_NETWORK_BATCH)] = CONFIG_VALUE(NO);
+ if (CommonTestUtils::vpu::CheckMyriad2()) {
+ config[VPU_CONFIG_KEY(DISABLE_REORDER)] = CONFIG_VALUE(YES);
+ }
+ return config;
+}
const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
- ::testing::Values(additional_config));
+ ::testing::Values(getConfig()));
INSTANTIATE_TEST_CASE_P(CompareWithRefs, EltwiseLayerTest, multiply_params, EltwiseLayerTest::getTestCaseName);
+
} // namespace
{
SizeVector ret(4);
if (dims.size() == 1) {
- ret[0] = dims[0];
- ret[1] = 1;
+ ret[0] = 1;
+ ret[1] = dims[0];
ret[2] = 1;
ret[3] = 1;
return ret;
}
if (dims.size() == 2) {
- ret[0] = dims[1];
- ret[1] = 1;
- ret[2] = 1;
- ret[3] = dims[0];
+ ret[0] = 1;
+ ret[1] = dims[1];
+ ret[2] = dims[0];
+ ret[3] = 1;
return ret;
}
GTEST_SKIP_("Please look at #-19681");
// inpt[2].resize(2);
} else {
- inpt[rand()%count].resize(rand()%ndims + 1);
+ const auto inputToResize = rand() % count;
+ const auto newSize = rand() % ndims + 1;
+ inpt[inputToResize].resize(newSize);
+ for (int i = 0; i < newSize; i++) {
+ inpt[inputToResize][newSize - i - 1] = dims[ndims - i - 1];
+ }
}
for (int i = 0; i < count; ++i) {
for (int j = 0; j < inpt[i].size(); j++) {
SetOutputTensors({dims});
_config[VPU_CONFIG_KEY(DETECT_NETWORK_BATCH)] = CONFIG_VALUE(NO);
+ if (!CheckMyriadX()) {
+ _config[VPU_CONFIG_KEY(DISABLE_REORDER)] = CONFIG_VALUE(YES);
+ }
ASSERT_NO_FATAL_FAILURE(makeSingleLayerNetwork(LayerInitParams("Eltwise").params(_params)));
ASSERT_TRUE(Infer());