From d80d1a17720f49dc36561a677d26f46e6c46a0f9 Mon Sep 17 00:00:00 2001 From: Ivan Tikhonov Date: Mon, 26 Jul 2021 19:23:42 +0300 Subject: [PATCH 1/4] MO DeformableConv: fix a set of attributes --- model-optimizer/mo/ops/deformable_convolution.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/model-optimizer/mo/ops/deformable_convolution.py b/model-optimizer/mo/ops/deformable_convolution.py index 5eb573fb2147f1..1bfa988e474ec6 100644 --- a/model-optimizer/mo/ops/deformable_convolution.py +++ b/model-optimizer/mo/ops/deformable_convolution.py @@ -27,4 +27,9 @@ def __init__(self, graph: Graph, attrs: dict): def backend_attrs(self): # the same attributes as in a regular convolution and additional attributes 'deformable_group', 'group' # and 'bilinear_interpolation_pad' - return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group', 'bilinear_interpolation_pad'] + version = self.get_opset() + if version == 'opset8': + return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group', + 'bilinear_interpolation_pad'] + else: + return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group'] \ No newline at end of file From 759240543066a856d8b7778fc01d5490712c7aec Mon Sep 17 00:00:00 2001 From: Ivan Tikhonov Date: Mon, 26 Jul 2021 19:26:42 +0300 Subject: [PATCH 2/4] codestyle --- model-optimizer/mo/ops/deformable_convolution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model-optimizer/mo/ops/deformable_convolution.py b/model-optimizer/mo/ops/deformable_convolution.py index 1bfa988e474ec6..b54440c03e1918 100644 --- a/model-optimizer/mo/ops/deformable_convolution.py +++ b/model-optimizer/mo/ops/deformable_convolution.py @@ -32,4 +32,4 @@ def backend_attrs(self): return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group', 'bilinear_interpolation_pad'] else: - return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group'] \ No newline at end of file + return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group'] From 01f74752f95ad01277654c7f00f67bbb59bd57be Mon Sep 17 00:00:00 2001 From: Ivan Tikhonov Date: Wed, 28 Jul 2021 10:36:22 +0300 Subject: [PATCH 3/4] resolve review comments --- model-optimizer/mo/ops/deformable_convolution.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/model-optimizer/mo/ops/deformable_convolution.py b/model-optimizer/mo/ops/deformable_convolution.py index b54440c03e1918..2bbd2fcb81ff33 100644 --- a/model-optimizer/mo/ops/deformable_convolution.py +++ b/model-optimizer/mo/ops/deformable_convolution.py @@ -27,9 +27,7 @@ def __init__(self, graph: Graph, attrs: dict): def backend_attrs(self): # the same attributes as in a regular convolution and additional attributes 'deformable_group', 'group' # and 'bilinear_interpolation_pad' - version = self.get_opset() - if version == 'opset8': - return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group', - 'bilinear_interpolation_pad'] - else: - return Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group'] + attrs = ['deformable_group', 'group'] + if self.get_opset() == 'opset8': + attrs.append('bilinear_interpolation_pad') + return attrs From 579118598cd92bae73333f7314c59e2b4803fe3a Mon Sep 17 00:00:00 2001 From: Ivan Tikhonov Date: Wed, 28 Jul 2021 16:05:23 +0300 Subject: [PATCH 4/4] resolve review comments --- model-optimizer/mo/ops/deformable_convolution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model-optimizer/mo/ops/deformable_convolution.py b/model-optimizer/mo/ops/deformable_convolution.py index 2bbd2fcb81ff33..14c7a39e03ef0d 100644 --- a/model-optimizer/mo/ops/deformable_convolution.py +++ b/model-optimizer/mo/ops/deformable_convolution.py @@ -27,7 +27,7 @@ def __init__(self, graph: Graph, attrs: dict): def backend_attrs(self): # the same attributes as in a regular convolution and additional attributes 'deformable_group', 'group' # and 'bilinear_interpolation_pad' - attrs = ['deformable_group', 'group'] + attrs = Convolution(self.graph, {}).backend_attrs() + ['deformable_group', 'group'] if self.get_opset() == 'opset8': attrs.append('bilinear_interpolation_pad') return attrs