nncf icon indicating copy to clipboard operation
nncf copied to clipboard

Support models without a batch dimension

Open Thakor-Yashpal opened this issue 1 month ago • 1 comments

Changes

  • Modified nncf/quantization/algorithms/fast_bias_correction/openvino_backend.py.
  • Updated the create_input_data method to add a specific check for 1D input shapes (i.e., len(shape) == 1).
  • When a 1D model is detected, the function now bypasses the per-channel loop and directly uses the single mean tensor from the data list.

Reason for changes

The create_input_data method was looping based on the channel dimension size (3) but should have been based on the statistics list size (1)

Related tickets

Closes the feature request: "Currently FastBiasCorrection algorithm does not support models without the batch dimension" https://github.com/openvinotoolkit/nncf/issues/3481

Tests

Verified the fix by running the reproducer command provided in the issue, which now passes:

python -m pytest tests/openvino/native/test_fast_bias_correction.py -k OneDimMM

Thakor-Yashpal avatar Nov 04 '25 23:11 Thakor-Yashpal

@daniil-lyakhov , please take a look

MaximProshin avatar Nov 05 '25 12:11 MaximProshin