Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/openvino/src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ impl Blob {

let mut dimensions = MaybeUninit::uninit();
try_unsafe!(ie_blob_get_dims(blob, dimensions.as_mut_ptr()))?;
// Safety: this assertion is trying to avoid the improbable case where some future version
// of the OpenVINO library returns a dimensions array with size different than the one
// auto-generated in the bindings; see `struct dimensions` in
// `openvino-sys/src/generated/types.rs`. It is not clear to me whether this will return the
// statically-expected size or the dynamic size -- this is not effective in the former case.
assert_eq!(unsafe { dimensions.assume_init() }.dims.len(), 8);

let mut precision = MaybeUninit::uninit();
try_unsafe!(ie_blob_get_precision(blob, precision.as_mut_ptr()))?;
Expand Down