pub struct Tensor { /* private fields */ }Expand description
A resident buffer with no unsynchronized mapped or raw access.
Implementations§
Source§impl Tensor
impl Tensor
Sourcepub fn guard(&self) -> TensorGuard<'_>
pub fn guard(&self) -> TensorGuard<'_>
Borrows completed resident storage without mapping it.
Sourcepub fn storage_bytes(&self) -> usize
pub fn storage_bytes(&self) -> usize
Returns logical native storage bytes including native tensor padding.
This is the amount the allocator accounts for, so it can exceed the element count times the
element width. Allocator::tensor_bytes sums the same figure.
Sourcepub fn download(&self) -> Result<Mat>
pub fn download(&self) -> Result<Mat>
Downloads and synchronizes into detached CPU-owned FP32 storage.
The call blocks and copies, which is the cost the performance page records as the
upload-download round trip. Read residency with TensorGuard::buffer_descriptor when the
values must stay on the device; a refusal is reported as
Error::NativeAt naming the operation.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Tensor
impl !Send for Tensor
impl !Sync for Tensor
impl !UnwindSafe for Tensor
impl Freeze for Tensor
impl Unpin for Tensor
impl UnsafeUnpin 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