Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit adffd87

Browse files
LeoIVbhushan23
authored andcommitted
fix wrong detection of mode if constant is byte string, provide default empty list for pads (#510)
1 parent 928955a commit adffd87

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

onnx_coreml/_operators_nd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,13 @@ def _convert_pad(builder, node, graph, err):
13091309
'''
13101310
mode = node.attrs.get('mode', 'constant')
13111311

1312+
try:
1313+
mode = mode.decode()
1314+
except (UnicodeDecodeError, AttributeError):
1315+
pass
1316+
13121317
if mode == 'constant':
1313-
pads = node.attrs.get('pads')
1318+
pads = node.attrs.get('pads', [])
13141319
value = node.attrs.get('value', 0.0)
13151320

13161321
builder.add_constant_pad(

0 commit comments

Comments
 (0)