[LPT] AddTransformation: inconsistent element types when subtract on fullPath is empty (#8277)
This commit is contained in:
parent
9999b786ac
commit
aa00ae8b43
@ -206,7 +206,9 @@ bool AddTransformation::transform(TransformationContext& context, ngraph::patter
|
|||||||
inputs[emptyPathIndex] = dequantizationEmptyPath.data;
|
inputs[emptyPathIndex] = dequantizationEmptyPath.data;
|
||||||
inputs[fullPathIndex] = std::make_shared<opset1::Multiply>(
|
inputs[fullPathIndex] = std::make_shared<opset1::Multiply>(
|
||||||
newSubtractFullPathValues == nullptr ?
|
newSubtractFullPathValues == nullptr ?
|
||||||
fullPathInput :
|
(fullPathInput.get_element_type() != newMultiplyFullPathValues->get_element_type() ?
|
||||||
|
std::make_shared<opset1::Convert>(fullPathInput, newMultiplyFullPathValues->get_element_type()) :
|
||||||
|
fullPathInput) :
|
||||||
std::make_shared<opset1::Subtract>(
|
std::make_shared<opset1::Subtract>(
|
||||||
// precision on branch with dequantization operations can be different with dequantization precision,
|
// precision on branch with dequantization operations can be different with dequantization precision,
|
||||||
// for example: FP16 model with FP32 dequantization
|
// for example: FP16 model with FP32 dequantization
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <ngraph/opsets/opset1.hpp>
|
#include <ngraph/opsets/opset1.hpp>
|
||||||
#include <ngraph/rt_info.hpp>
|
#include <ngraph/rt_info.hpp>
|
||||||
#include <ngraph/pattern/op/wrap_type.hpp>
|
#include <ngraph/pattern/op/wrap_type.hpp>
|
||||||
|
#include <transformations/utils/utils.hpp>
|
||||||
|
|
||||||
NGRAPH_RTTI_DEFINITION(ngraph::pass::PullTransposeThroughFQUp, "PullTransposeThroughFQUp", 0);
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::PullTransposeThroughFQUp, "PullTransposeThroughFQUp", 0);
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ ngraph::pass::PullTransposeThroughFQUp::PullTransposeThroughFQUp() {
|
|||||||
opset1::Constant::create(element::i64, Shape{unsqueeze_axes.size()}, unsqueeze_axes));
|
opset1::Constant::create(element::i64, Shape{unsqueeze_axes.size()}, unsqueeze_axes));
|
||||||
new_ops.push_back(fq_input.get_node_shared_ptr());
|
new_ops.push_back(fq_input.get_node_shared_ptr());
|
||||||
}
|
}
|
||||||
fq_input = transpose->clone_with_new_inputs({fq_input, transpose->input_value(1)});
|
fq_input = op::util::make_try_fold<opset1::Transpose>(fq_input, transpose->input_value(1));
|
||||||
ngraph::copy_runtime_info(transpose, fq_input.get_node_shared_ptr());
|
ngraph::copy_runtime_info(transpose, fq_input.get_node_shared_ptr());
|
||||||
fq_inputs.push_back(fq_input);
|
fq_inputs.push_back(fq_input);
|
||||||
}
|
}
|
||||||
|
@ -931,6 +931,28 @@ const std::vector<AddTransformationTestValues> testValues = {
|
|||||||
},
|
},
|
||||||
""
|
""
|
||||||
},
|
},
|
||||||
|
// float path without subtract
|
||||||
|
{
|
||||||
|
false,
|
||||||
|
-1,
|
||||||
|
LayerTransformation::createParamsU8I8(),
|
||||||
|
{
|
||||||
|
ngraph::element::f32,
|
||||||
|
{ },
|
||||||
|
ngraph::element::u8,
|
||||||
|
{ {ngraph::element::f32}, {}, { 4.f }},
|
||||||
|
{ }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ngraph::element::f32,
|
||||||
|
{ {ngraph::element::f32}, {}, { 0.25f } },
|
||||||
|
ngraph::element::u8,
|
||||||
|
{ },
|
||||||
|
{ {}, {}, { 4.f }},
|
||||||
|
{ }
|
||||||
|
},
|
||||||
|
""
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
Loading…
Reference in New Issue
Block a user