Added callback to disable PriorBox to PriorBoxIE transformation (#2159)
* move priorbox to ie transformations to Opset1ToLegacyOpset pipeline * fix typo * Revert "fix typo" This reverts commit4077a78cbd
. * Revert "move priorbox to ie transformations to Opset1ToLegacyOpset pipeline" This reverts commit910e41ff20
. * add functionality to disable prior box to ie transformation * fix callback
This commit is contained in:
parent
f157319792
commit
a20d7ba384
@ -33,14 +33,14 @@ void ngraph::pass::ConvertPriorBox::convert_prior_box() {
|
||||
auto prior_box = std::make_shared<ngraph::opset1::PriorBox>(data, image, attr);
|
||||
auto unsqueeze = std::make_shared<ngraph::opset1::Unsqueeze> (prior_box, axes);
|
||||
|
||||
ngraph::graph_rewrite_callback callback = [](pattern::Matcher& m) {
|
||||
ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) {
|
||||
auto unsqueeze = std::dynamic_pointer_cast<ngraph::opset1::Unsqueeze> (m.get_match_root());
|
||||
if (!unsqueeze) {
|
||||
return false;
|
||||
}
|
||||
auto prior_box_node = std::dynamic_pointer_cast<ngraph::opset1::PriorBox> (unsqueeze->input_value(0).get_node_shared_ptr());
|
||||
|
||||
if (!prior_box_node) {
|
||||
if (!prior_box_node || m_transformation_callback(prior_box_node)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -172,14 +172,14 @@ void ngraph::pass::ConvertPriorBox::convert_prior_box_clustered() {
|
||||
auto prior_box = std::make_shared<ngraph::opset1::PriorBoxClustered>(data, image, attr);
|
||||
auto unsqueeze = std::make_shared<ngraph::opset1::Unsqueeze> (prior_box, axes);
|
||||
|
||||
ngraph::graph_rewrite_callback callback = [](pattern::Matcher& m) {
|
||||
ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) {
|
||||
auto unsqueeze = std::dynamic_pointer_cast<ngraph::opset1::Unsqueeze> (m.get_match_root());
|
||||
if (!unsqueeze) {
|
||||
return false;
|
||||
}
|
||||
auto prior_box_node = std::dynamic_pointer_cast<ngraph::opset1::PriorBoxClustered>(unsqueeze->input_value(0).get_node_shared_ptr());
|
||||
|
||||
if (!prior_box_node) {
|
||||
if (!prior_box_node || m_transformation_callback(prior_box_node)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user