You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pruning): normalize a negative channel axis (#45)
* fix(pruning): normalize a negative channel axis
ChannelStructured(axis=-1) pruned the wrong channels.
_compute_channel_mask compared each dim index against the raw axis when building its reduce list, so a negative axis excluded nothing and the per-channel L1 norms collapsed to a scalar.
Normalize the axis first, matching PerChannelGranularity, and reject an out-of-range axis with ValueError rather than letting it reach the reduction.
* refactor: move axis normalization into a shared util
`_compute_channel_mask` and `QuantizationGranularity._resolve_axis` both resolved a negative axis against the tensor rank. The shared helper lives in `torch_utils`. It resolves the axis and nothing else, so the range check stays where pruning already had it and the quantization path is unchanged.
0 commit comments