[−][src]Struct openvino::Blob
See Blob.
Implementations
impl Blob
[src]
pub fn new(description: TensorDesc, data: &[u8]) -> Result<Self, InferenceError>
[src]
Create a new Blob by copying data in to the OpenVINO-allocated memory.
pub fn allocate(description: TensorDesc) -> Result<Self, InferenceError>
[src]
Allocate space in OpenVINO for an empty Blob.
pub fn tensor_desc(&self) -> Result<TensorDesc, InferenceError>
[src]
Return the tensor description of this Blob.
pub fn len(&mut self) -> Result<usize, InferenceError>
[src]
Get the number of elements contained in the Blob.
pub fn byte_len(&mut self) -> Result<usize, InferenceError>
[src]
Get the size of the current Blob in bytes.
pub fn buffer(&mut self) -> Result<&[u8], InferenceError>
[src]
Retrieve the Blob's data as an immutable slice of bytes.
pub fn buffer_mut(&mut self) -> Result<&mut [u8], InferenceError>
[src]
Retrieve the Blob's data as a mutable slice of bytes.
pub unsafe fn buffer_mut_as_type<T>(
&mut self
) -> Result<&mut [T], InferenceError>
[src]
&mut self
) -> Result<&mut [T], InferenceError>
Retrieve the Blob's data as a mutable slice of type T
. This is unsafe
, since the
values of T
may not have been properly initialized; however, this functionality
is provided as an equivalent of what C/C++ users of OpenVINO currently do to access Blobs
with, e.g., floating point values: results.buffer_mut_as_type::<f32>()
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Blob
[src]
impl !Send for Blob
[src]
impl !Sync for Blob
[src]
impl Unpin for Blob
[src]
impl UnwindSafe for Blob
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,