nncf
nncf copied to clipboard
[Torch] Do not wrap not tensor inputs
Changes
- NNCF wrapping for Tensor input parameters is skipped when actual parameter is not a tensor
Reason for changes
- To support models which could accept different types as an input (example: YolovV8
def forward(self, x, *args, **kwargs):
if isinstance(x, dict): # for cases of training and validating while training.
return self.loss(x, *args, **kwargs)
return self.predict(x, *args, **kwargs)
Related tickets
138682
Tests
- tests/torch/test_input_management.py is extended
Codecov Report
Attention: Patch coverage is 85.71429%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 77.96%. Comparing base (
fa1a4ce
) to head (3a15424
). Report is 2 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #2649 +/- ##
============================================
- Coverage 89.84% 77.96% -11.89%
============================================
Files 494 493 -1
Lines 45374 45450 +76
============================================
- Hits 40768 35434 -5334
- Misses 4606 10016 +5410
Files | Coverage Δ | |
---|---|---|
nncf/torch/dynamic_graph/io_handling.py | 93.81% <85.71%> (+0.69%) |
:arrow_up: |
... and 108 files with indirect coverage changes
Flag | Coverage Δ | |
---|---|---|
ONNX | ? |
|
OPENVINO | ? |
|
TENSORFLOW | 30.08% <0.00%> (-0.05%) |
:arrow_down: |
TORCH | 66.00% <85.71%> (+0.04%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Components | Coverage Δ | |
---|---|---|
common | 88.28% <ø> (-1.26%) |
:arrow_down: |
torch | 93.60% <85.71%> (+0.10%) |
:arrow_up: |
tensorflow | 93.74% <ø> (-0.01%) |
:arrow_down: |
onnx | 0.00% <ø> (-93.08%) |
:arrow_down: |
openvino | 25.67% <ø> (-68.50%) |
:arrow_down: |
ptq | 53.03% <ø> (-32.17%) |
:arrow_down: |