Add CHW/HWC heuristics for tensors with 3 dimensions (#10817)

This commit is contained in:
Fedor Zharinov
2022-03-23 16:54:56 +03:00
committed by GitHub
parent 75bbfe336d
commit 1315cfaa64
2 changed files with 5 additions and 2 deletions

View File

@@ -473,7 +473,10 @@ std::vector<benchmark_app::InputsInfo> get_inputs_info(const std::string& shape_
if (info.layout.empty()) {
switch (item.get_partial_shape().size()) {
case 3:
newLayout = "CHW";
newLayout = (item.get_partial_shape()[2].get_max_length() <= 4 &&
item.get_partial_shape()[0].get_max_length() > 4)
? "HWC"
: "CHW";
break;
case 4:
// Rough check for layout type, basing on max number of image channels

View File

@@ -60,9 +60,9 @@ void printInputAndOutputsInfoShort(const T& network) {
in_name += name + " , ";
}
in_name = in_name.substr(0, in_name.size() - 3);
} catch (const ov::Exception&) {
}
try {
node_name = input.get_node()->get_friendly_name();
} catch (const ov::Exception&) {