pub struct Execution { /* private fields */ }Expand description
Resolved resources and policies used to execute models.
Implementations§
Source§impl Execution
impl Execution
Sourcepub fn local(options: ExecutionOptions) -> RuntimeResult<Self>
pub fn local(options: ExecutionOptions) -> RuntimeResult<Self>
Creates a non-distributed execution context from options.
§Errors
Returns [RuntimeError] when the requested backend or precision is
unavailable, GPU initialization fails, or the CPU thread pool cannot be
created.
Sourcepub fn requested_device(&self) -> &Device
pub fn requested_device(&self) -> &Device
Returns the device requested when this context was created.
Sourcepub fn autodiff_mode(&self) -> AutodiffMode
pub fn autodiff_mode(&self) -> AutodiffMode
Returns the automatic-differentiation strategy.
Sourcepub fn thread_policy(&self) -> ThreadPolicy
pub fn thread_policy(&self) -> ThreadPolicy
Returns the CPU worker-thread policy.
Sourcepub fn jit_policy(&self) -> JitPolicy
pub fn jit_policy(&self) -> JitPolicy
Returns the CPU JIT policy.
Sourcepub fn partitioning(&self) -> Partitioning
pub fn partitioning(&self) -> Partitioning
Returns the distributed dataset-partitioning strategy.
Sourcepub fn memory_state(&self) -> &MemoryState
pub fn memory_state(&self) -> &MemoryState
Returns the live memory state shared by this execution.
Sourcepub fn host_memory(&self) -> &MemoryPool
pub fn host_memory(&self) -> &MemoryPool
Returns the resolved host-memory pool.
Sourcepub fn device_memory(&self) -> Option<&MemoryPool>
pub fn device_memory(&self) -> Option<&MemoryPool>
Returns the resolved accelerator-memory pool, if any.
Sourcepub fn memory_report(&self) -> MemoryReport
pub fn memory_report(&self) -> MemoryReport
Returns current physical-resource memory information.
Sourcepub fn memory_pool_reports(&self) -> Vec<MemoryPoolReport>
pub fn memory_pool_reports(&self) -> Vec<MemoryPoolReport>
Returns the resolved execution-pool reports.
Sourcepub fn memory_decisions(&self) -> Vec<MemoryDecision>
pub fn memory_decisions(&self) -> Vec<MemoryDecision>
Returns memory-derived decisions recorded by this execution.
Sourcepub fn record_memory_decision(&self, decision: MemoryDecision)
pub fn record_memory_decision(&self, decision: MemoryDecision)
Records a memory-planning decision for later diagnostics.
Sourcepub fn is_distributed(&self) -> bool
pub fn is_distributed(&self) -> bool
Returns whether this context spans more than one rank.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Execution
impl !UnwindSafe for Execution
impl Freeze for Execution
impl Send for Execution
impl Sync for Execution
impl Unpin for Execution
impl UnsafeUnpin for Execution
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.