Trait DeviceStorage
Source pub trait DeviceStorage {
Show 13 methods
// Required methods
fn view(&self, new_shape: Vec<usize>) -> Self
where Self: Sized;
fn data(&self) -> Arc<RwLock<Vec<f32>>>;
fn data_mut(&self) -> RwLockWriteGuard<'_, Vec<f32>>;
fn set_data(&mut self, data: Vec<f32>);
fn shape(&self) -> &Vec<usize>;
fn set_shape(&mut self, shape: Vec<usize>);
fn stride(&self) -> &Vec<usize>;
fn set_stride(&mut self, stride: Vec<usize>);
fn offset(&self) -> usize;
fn get(&self, indices: &[usize]) -> f32;
fn set(&mut self, indices: &[usize], value: f32);
fn make_contiguous(&self) -> (Vec<f32>, i32);
fn is_contiguous(&self) -> bool;
}