Skip to content

[Fix] Avoid accessing parents_node_mapping[tensor_name] when the tensor is a model input and has no parent node - #4169

Merged
andrey-churkin merged 1 commit into
openvinotoolkit:developfrom
andrey-churkin:ac/cvs192069
Aug 11, 2026
Merged

[Fix] Avoid accessing parents_node_mapping[tensor_name] when the tensor is a model input and has no parent node#4169
andrey-churkin merged 1 commit into
openvinotoolkit:developfrom
andrey-churkin:ac/cvs192069

Conversation

@andrey-churkin

@andrey-churkin andrey-churkin commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Changes

In the _get_bias_attr() function, we access parents_node_mapping[tensor_name] to get the parent node that produces the tensor with the given tensor_name. However, the tensor can also be a model input, in which case it does not have a parent node. This results in a KeyError.

The fix handles this case correctly by checking whether a parent node exists before accessing its op_type.

Reason for changes

A KeyError was raised when tensor_name referred to a model input that did not have a corresponding entry in parents_node_mapping.

Related tickets

CVS-192069

Tests

test_get_bias_attr

Weight compression - success

Test examples - success

@andrey-churkin
andrey-churkin requested a review from anzr299 August 11, 2026 09:04
@andrey-churkin
andrey-churkin requested a review from a team as a code owner August 11, 2026 09:04
@github-actions github-actions Bot added the NNCF ONNX Pull requests that updates NNCF ONNX label Aug 11, 2026
@andrey-churkin
andrey-churkin merged commit 909ebeb into openvinotoolkit:develop Aug 11, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NNCF ONNX Pull requests that updates NNCF ONNX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants