Skip to content

Commit

Permalink
default options avgpool2
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaybati committed Jun 9, 2023
1 parent 98baa66 commit a3b51ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fLibrary/modelParserONNX.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,11 @@ def spreadInfo(trueShape, toBeTransformedShape):
elif layer == "AveragePool":
f.write(layer)
f.write("\n")
names = [n.name for n in node.attribute]
attributes = [node.attribute[0].i if 'ceil_mode' in names else 0,
node.attribute[2].ints if 'pads' in names else [0,0,0,0],
node.attribute[3].ints if 'strides' in names else [1,1]]
#https://onnx.ai/onnx/api/mapping.html#l-onnx-types-mapping
names = {n.name:n.i if n.type==2 else n.ints for n in node.attribute}
attributes = [names.get('ceil_mode', 0),
names.get('pads', [0,0,0,0]),
names.get('strides', [1,1])]
modelArch.append(("AveragePool", [ioMap[node.input[0]]], attributes)) #(ceil_mode, pads, strides)
f.write(str(node.attribute[1].ints[0]))
f.write("\n")
Expand Down

0 comments on commit a3b51ae

Please sign in to comment.