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>>
Sourcepub fn copy_to_i32(&self, buf: &mut [i32]) -> Result<()>
pub fn copy_to_i32(&self, buf: &mut [i32]) -> Result<()>
Copy output data as i32 values.
Sourcepub fn to_vec_i32(&self) -> Result<Vec<i32>>
pub fn to_vec_i32(&self) -> Result<Vec<i32>>
Convert to Vec
Sourcepub fn copy_to_f64(&self, buf: &mut [f64]) -> Result<()>
pub fn copy_to_f64(&self, buf: &mut [f64]) -> Result<()>
Copy output data as f64 values.
Sourcepub fn to_vec_f64(&self) -> Result<Vec<f64>>
pub fn to_vec_f64(&self) -> Result<Vec<f64>>
Convert to Vec
Sourcepub fn to_raw_bytes(&self) -> Result<Vec<u8>>
pub fn to_raw_bytes(&self) -> Result<Vec<u8>>
Returns a Vec
Trait Implementations§
Source§impl AsMultiArray for OwnedTensor
Available on Apple only.
impl AsMultiArray for OwnedTensor
Available on Apple only.
fn as_ml_multi_array(&self) -> &Retained<MLMultiArray>
Source§impl Debug for OwnedTensor
impl Debug for OwnedTensor
impl Send for OwnedTensor
Auto Trait Implementations§
impl Freeze for OwnedTensor
impl !RefUnwindSafe 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