Trait candle_core::WithDType
source · pub trait WithDType: Sized + Copy + NumAssign + PartialOrd + Display + 'static + Send + Sync + Any + VecOps {
const DTYPE: DType;
// Required methods
fn from_f64(v: f64) -> Self;
fn to_f64(self) -> f64;
fn cpu_storage_ref(data: &[Self]) -> CpuStorageRef<'_>;
fn to_cpu_storage_owned(data: Vec<Self>) -> CpuStorage;
fn cpu_storage_as_slice(s: &CpuStorage) -> Result<&[Self]>;
fn cpu_storage_data(s: CpuStorage) -> Result<Vec<Self>>;
// Provided method
fn to_cpu_storage(data: &[Self]) -> CpuStorage { ... }
}
Required Associated Constants§
Required Methods§
fn from_f64(v: f64) -> Self
fn to_f64(self) -> f64
fn cpu_storage_ref(data: &[Self]) -> CpuStorageRef<'_>
fn to_cpu_storage_owned(data: Vec<Self>) -> CpuStorage
fn cpu_storage_as_slice(s: &CpuStorage) -> Result<&[Self]>
fn cpu_storage_data(s: CpuStorage) -> Result<Vec<Self>>
Provided Methods§
fn to_cpu_storage(data: &[Self]) -> CpuStorage
Object Safety§
This trait is not object safe.