@@ -71,7 +71,7 @@ def transform(self, model, node):
71
71
model .config .parse_name_config (dw_name , dw_layer_config )
72
72
73
73
# creating the attributes
74
- dw_attributes = {k : node .attributes . get ( k , None ) for k in SeperableToDepthwiseAndConv ._dw_attributes }
74
+ dw_attributes = {k : node .attributes [ k ] for k in SeperableToDepthwiseAndConv ._dw_attributes if k in node . attributes }
75
75
76
76
dw_attributes ['use_bias' ] = False
77
77
@@ -101,7 +101,7 @@ def transform(self, model, node):
101
101
model .config .parse_name_config (pw_name , pw_layer_config )
102
102
103
103
# creating the attributes
104
- pw_attributes = {k : node .attributes . get ( k , None ) for k in SeperableToDepthwiseAndConv ._pw_attributes }
104
+ pw_attributes = {k : node .attributes [ k ] for k in SeperableToDepthwiseAndConv ._pw_attributes if k in node . attributes }
105
105
pw_attributes ['filt_width' ] = 1
106
106
pw_attributes ['filt_height' ] = 1
107
107
pw_attributes ['stride_width' ] = 1
@@ -111,7 +111,7 @@ def transform(self, model, node):
111
111
pw_attributes ['pad_top' ] = 0
112
112
pw_attributes ['pad_bottom' ] = 0
113
113
pw_attributes ['in_width' ] = pw_attributes ['out_width' ]
114
- pw_attributes ['in_height' ] = pw_attributes [ 'out_height' ]
114
+ pw_attributes ['in_height' ] = pw_attributes . get ( 'out_height' , 1 )
115
115
pw_attributes ['n_chan' ] = node .get_attr ('n_chan' ) * node .get_attr ('depth_multiplier' )
116
116
pw_attributes ['weight_data' ] = node .get_attr ('pointwise_data' )
117
117
pw_attributes ['weight_quantizer' ] = node .get_attr ('pointwise_quantizer' )
0 commit comments