pub struct Tensor { /* private fields */ }Expand description
An ONNX tensor with a name, shape, data type, and optional underlying data
Implementations§
Source§impl Tensor
impl Tensor
Sourcepub fn has_data(&self) -> bool
pub fn has_data(&self) -> bool
Returns true if this tensor contains data.
This check does not trigger loading or memory-mapping of external files.
Sourcepub fn data(&self) -> Result<TensorDataRef<'_>, Error>
pub fn data(&self) -> Result<TensorDataRef<'_>, Error>
Borrow tensor data
- All variants are returned without copying the underlying tensor data.
- External data is loaded from disk if not already in memory.
Sourcepub fn into_data(self) -> Result<TensorData, Error>
pub fn into_data(self) -> Result<TensorData, Error>
Consume tensor and return owned data
- All variants are returned without copying the underlying tensor data.
- External data is loaded from disk if not already in memory.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Tensor
impl RefUnwindSafe for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl UnsafeUnpin for Tensor
impl UnwindSafe for Tensor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more