Skip to content

Commit d102554

Browse files
intbfMayureshV1Copilot
authored
Fix Regression in Model PSS and PSR, add check for zero-size initializers (#825)
* check for the size of RAW data, skip if it's zero Signed-off-by: bfilipek <[email protected]> * Update onnxruntime/core/providers/openvino/backend_manager.cc Co-authored-by: Copilot <[email protected]> --------- Signed-off-by: bfilipek <[email protected]> Co-authored-by: MayureshV1 <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent f8b0904 commit d102554

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

onnxruntime/core/providers/openvino/backend_manager.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,10 @@ BackendManager::GetModelProtoFromFusedNode(const onnxruntime::Node& fused_node,
673673
<< src_init->name()
674674
<< ", data_type: " << src_init->data_type()
675675
<< ", raw_data size: " << src_init->raw_data().size();
676-
677-
SetExternalDataFields(proto_init, src_init->raw_data().data(), src_init->raw_data().size());
676+
if (src_init->raw_data().size() > 0)
677+
SetExternalDataFields(proto_init, src_init->raw_data().data(), src_init->raw_data().size());
678+
else
679+
LOGS(logger, VERBOSE) << "Initializer has empty raw_data: skipping initializer '" << src_init->name() << "'...";
678680
} else if (onnxruntime::utils::HasExternalDataInMemory(*src_init)) {
679681
auto it_ext = external_initializers_offset_and_length.find(name);
680682
if (it_ext == external_initializers_offset_and_length.end()) {

0 commit comments

Comments
 (0)