[LPT] Transpose, MatMul: Klocwork fixes (#3192)

This commit is contained in:
Vladislav Golubev
2020-11-19 15:15:39 +03:00
committed by GitHub
parent 322bc3498b
commit 6959f6671f
2 changed files with 6 additions and 3 deletions

View File

@@ -151,6 +151,9 @@ bool MatMulTransformation::canBeTransformed(const TransformationContext& context
}
std::shared_ptr<opset1::MatMul> matMul = as_type_ptr<opset1::MatMul>(layer);
if (matMul == nullptr) {
return false;
}
const size_t channelIndex1 = matMul->get_transpose_a() ? 0 : 1;
const size_t channelIndex2 = matMul->get_transpose_b() ? 1 : 0;

View File

@@ -31,7 +31,7 @@ void transposeDequantizationConstant(std::shared_ptr<Node>& transpose) {
}
if (dequantization.multiply->get_input_node_ptr(1)->get_output_shape(0).size() > 1ul) {
auto transposeConstant = [](
auto transposeDeqConstant = [](
std::shared_ptr<Node> dequantizationConstant,
const Shape& transposeOutputShape,
const std::shared_ptr<Node>& transposeConstant) -> std::shared_ptr<Node> {
@@ -49,7 +49,7 @@ void transposeDequantizationConstant(std::shared_ptr<Node>& transpose) {
};
if (dequantization.subtract != nullptr) {
auto constant = transposeConstant(
auto constant = transposeDeqConstant(
dequantization.subtract->get_input_node_shared_ptr(1),
transpose->get_output_shape(0),
transpose->get_input_node_shared_ptr(1));
@@ -61,7 +61,7 @@ void transposeDequantizationConstant(std::shared_ptr<Node>& transpose) {
}
if (dequantization.multiply != nullptr) {
auto constant = transposeConstant(
auto constant = transposeDeqConstant(
dequantization.multiply->get_input_node_shared_ptr(1),
transpose->get_output_shape(0),
transpose->get_input_node_shared_ptr(1));