Skip to content

Commit 72538ad

Browse files
committed
fix corner case in qkeras converted proxy
1 parent 009e10f commit 72538ad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hls4ml/model/optimizer/passes/bit_exact.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ def _(layer: Merge):
304304
qint_in0 = QIntervalArray.from_kif(*kif_ins[0])
305305
qint_in1 = QIntervalArray.from_kif(*kif_ins[1])
306306
k, i, f = (qint_in0 @ qint_in1).to_kif()
307+
if k.shape == ():
308+
k, i, f = k[None], i[None], f[None]
307309
case _:
308310
raise NotImplementedError(f'No implementation of Merge for {op}')
309311
return k.astype(np.int8), i, f

0 commit comments

Comments
 (0)