pub trait TensorStorage:
Send
+ Sync
+ Debug
+ Display {
// Required methods
fn byte_len(&self) -> usize;
fn is_empty(&self) -> bool;
fn deep_clone(&self) -> Box<dyn TensorStorage>;
fn same_as(&self, other: &dyn TensorStorage) -> bool;
fn as_dense(&self) -> Option<&DenseStorage>;
fn as_dense_mut(&mut self) -> Option<&mut DenseStorage>;
fn into_dense(self: Box<Self>) -> Option<DenseStorage>;
}Expand description
Trait abstracting over tensor storage backends.
DenseStorage is the primary implementation backed by a contiguous Blob.
Non-dense backends are held behind StorageKind::Other(Box<dyn TensorStorage>).