pub struct DeviceSettings {
pub float_dtype: FloatDType,
pub int_dtype: IntDType,
pub bool_dtype: BoolStore,
}Expand description
Settings controlling the default data types for a specific device.
These settings are managed in a global registry that enforces strict initialization semantics:
- Manual Initialization: You can set these once at the start of your program using
set_default_dtypes. - Default Initialization: If an operation (like creating a tensor) occurs before manual initialization, the settings are permanently locked to their default values.
- Immutability: Once initialized, settings cannot be changed. This ensures consistent behavior across all threads and operations.
Fields§
§float_dtype: FloatDTypeDefault floating-point data type.
int_dtype: IntDTypeDefault integer data type.
bool_dtype: BoolStoreDefault bool data type.
Trait Implementations§
Source§impl Clone for DeviceSettings
impl Clone for DeviceSettings
Source§fn clone(&self) -> DeviceSettings
fn clone(&self) -> DeviceSettings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeviceSettings
impl Debug for DeviceSettings
Source§impl PartialEq for DeviceSettings
impl PartialEq for DeviceSettings
impl Copy for DeviceSettings
impl Eq for DeviceSettings
impl StructuralPartialEq for DeviceSettings
Auto Trait Implementations§
impl Freeze for DeviceSettings
impl RefUnwindSafe for DeviceSettings
impl Send for DeviceSettings
impl Sync for DeviceSettings
impl Unpin for DeviceSettings
impl UnsafeUnpin for DeviceSettings
impl UnwindSafe for DeviceSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.