Skip to content

Commit 01a326d

Browse files
lukamacXeratec
authored andcommitted
Add defaults for the group attribute
1 parent cbc78e9 commit 01a326d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Deeploy/CommonExtensions/OptimizationPasses/TopologyOptimizationPasses/LoweringOptimizationPasses.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ def _NCWHtoNHWC_dw_fun(graph: gs.Graph, match: Match, name: str, default_channel
273273
node = next(iter((match.nodes_map.values())))
274274
assert node.op in ["RequantizedConv", "Conv"]
275275

276-
if node.attrs["group"] == 1:
276+
# Skip non-dw nodes
277+
if node.attrs.get("group", 1) == 1:
277278
return graph
278279

279280
channels_first = node.attrs.get("channels_first", True)
@@ -315,7 +316,7 @@ def _PULP_NCHWtoNHWC_dw_fun(graph: gs.Graph, match: Match, name: str, default_ch
315316
node = next(iter((match.nodes_map.values())))
316317

317318
# Skip non-dw nodes
318-
if node.attrs["group"] == 1:
319+
if node.attrs.get("group", 1) == 1:
319320
return graph
320321

321322
channels_first = node.attrs.get("channels_first", True)

0 commit comments

Comments
 (0)