pub struct OwnedTensor { /* private fields */ }Implementations§
Source§impl OwnedTensor
impl OwnedTensor
pub fn zeros(_data_type: DataType, shape: &[usize]) -> Result<Self>
pub fn shape(&self) -> &[usize]
pub fn data_type(&self) -> DataType
pub fn element_count(&self) -> usize
pub fn size_bytes(&self) -> usize
pub fn copy_to_f32(&self, _buf: &mut [f32]) -> Result<()>
pub fn to_vec_f32(&self) -> Result<Vec<f32>>
pub fn copy_to_i32(&self, _buf: &mut [i32]) -> Result<()>
pub fn to_vec_i32(&self) -> Result<Vec<i32>>
pub fn copy_to_f64(&self, _buf: &mut [f64]) -> Result<()>
pub fn to_vec_f64(&self) -> Result<Vec<f64>>
pub fn to_raw_bytes(&self) -> Result<Vec<u8>>
Trait Implementations§
Source§impl Debug for OwnedTensor
impl Debug for OwnedTensor
impl AsMultiArray for OwnedTensor
Available on non-Apple only.
Auto Trait Implementations§
impl Freeze for OwnedTensor
impl RefUnwindSafe for OwnedTensor
impl Send for OwnedTensor
impl Sync for OwnedTensor
impl Unpin for OwnedTensor
impl UnsafeUnpin for OwnedTensor
impl UnwindSafe for OwnedTensor
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