pub trait TensorStorage:
Clone
+ Send
+ Sync
+ Debug {
// Required methods
fn dtype(&self) -> DType;
fn device(&self) -> Device;
fn nbytes(&self) -> usize;
fn is_contiguous(&self) -> bool;
fn alignment(&self) -> usize;
}Expand description
Tensor 存储后端 trait
Required Methods§
Sourcefn is_contiguous(&self) -> bool
fn is_contiguous(&self) -> bool
检查是否连续存储
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl TensorStorage for UnifiedStorage
impl TensorStorage for NdArrayStorage
Available on crate feature
tensor only.