Skip to content

fix(qonnx): handle scalar zpt for per-tensor bias quantization#238

Open
narutozxp wants to merge 1 commit into
fastmachinelearning:mainfrom
narutozxp:main
Open

fix(qonnx): handle scalar zpt for per-tensor bias quantization#238
narutozxp wants to merge 1 commit into
fastmachinelearning:mainfrom
narutozxp:main

Conversation

@narutozxp

Copy link
Copy Markdown

When Conv bias quantization is enabled with per-tensor quantization, exported QONNX models may not always use the same shape representation for scale and zero-point. The scale may be stored as (1,), while the zero-point may be stored as ().

The previous logic relied on shape comparison against (1,), which could fail to catch this scalar zero-point representation. If this case is not handled explicitly, the subsequent reshape operation can fail because the zero-point shape is not normalized to the expected per-tensor form.

This PR makes the check semantically correct by treating both forms as valid per-tensor quantization parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant