Trait WithDType
pub trait WithDType:
Copy
+ Send
+ Sync
+ 'static
+ NumCast
+ Debug {
const DTYPE: DType;
// Required methods
fn to_f64(self) -> f64;
fn from_f64(v: f64) -> Self;
// Provided methods
fn zero() -> Self { ... }
fn one() -> Self { ... }
}Expand description
Re-export core types. Trait implemented by Rust types that can be stored in a tensor.
Provides the mapping between the concrete Rust type and the DType enum, plus conversions to/from f64 for numeric operations.
Required Associated Constants§
Required Methods§
Provided Methods§
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.