Skip to content

fix modelwriter padding crash on empty per_channel_pad_data#6533

Merged
nihui merged 1 commit into
Tencent:masterfrom
nihui:fix-model-writer-pad
Feb 4, 2026
Merged

fix modelwriter padding crash on empty per_channel_pad_data#6533
nihui merged 1 commit into
Tencent:masterfrom
nihui:fix-model-writer-pad

Conversation

@nihui
Copy link
Copy Markdown
Member

@nihui nihui commented Feb 4, 2026

No description provided.

@github-actions github-actions Bot added the tool label Feb 4, 2026
@tencent-adm
Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a crash in the ModelWriter when saving models with Padding layers that have empty per_channel_pad_data. The fix adds a size check before attempting to write the per-channel padding data to the binary file.

Changes:

  • Added conditional check for per_channel_pad_data_size > 0 before writing per-channel padding data in the Padding layer serialization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nihui nihui changed the title fix modelwriter pad crash on empty per_channel_pad_data fix modelwriter padding crash on empty per_channel_pad_data Feb 4, 2026
@nihui nihui merged commit ec19da2 into Tencent:master Feb 4, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants