pub struct ParallelScirs2Exec {
pub config: ParallelConfig,
pub stats: Option<ParallelStats>,
/* private fields */
}Expand description
Parallel executor using Rayon for multi-threaded execution.
Fields§
§config: ParallelConfigConfiguration for parallel execution
stats: Option<ParallelStats>Statistics from last execution
Implementations§
Source§impl ParallelScirs2Exec
impl ParallelScirs2Exec
Sourcepub fn with_config(config: ParallelConfig) -> Self
pub fn with_config(config: ParallelConfig) -> Self
Create a parallel executor with custom configuration.
Sourcepub fn set_num_threads(&mut self, num_threads: usize)
pub fn set_num_threads(&mut self, num_threads: usize)
Set the number of threads to use.
pub fn num_threads(&self) -> usize
Sourcepub fn set_pooling(&mut self, enable: bool)
pub fn set_pooling(&mut self, enable: bool)
Enable or disable memory pooling.
Sourcepub fn pool_stats(&self) -> Option<PoolStats>
pub fn pool_stats(&self) -> Option<PoolStats>
Get pool statistics if pooling is enabled.
Sourcepub fn execution_stats(&self) -> Option<&ParallelStats>
pub fn execution_stats(&self) -> Option<&ParallelStats>
Get statistics from the last execution.
Sourcepub fn add_tensor(&mut self, name: impl Into<String>, tensor: Scirs2Tensor)
pub fn add_tensor(&mut self, name: impl Into<String>, tensor: Scirs2Tensor)
Add a named tensor to the executor.
Sourcepub fn get_tensor(&self, name: &str) -> Option<&Scirs2Tensor>
pub fn get_tensor(&self, name: &str) -> Option<&Scirs2Tensor>
Get a tensor by name.
Trait Implementations§
Source§impl Default for ParallelScirs2Exec
impl Default for ParallelScirs2Exec
Source§impl TlAutodiff for ParallelScirs2Exec
Available on non-crate feature parallel only.
impl TlAutodiff for ParallelScirs2Exec
Available on non-crate feature
parallel only.Source§impl TlExecutor for ParallelScirs2Exec
impl TlExecutor for ParallelScirs2Exec
type Tensor = ArrayBase<OwnedRepr<f64>, Dim<IxDynImpl>>
type Error = ExecutorError
Source§fn einsum(
&mut self,
spec: &str,
inputs: &[Self::Tensor],
) -> Result<Self::Tensor, Self::Error>
fn einsum( &mut self, spec: &str, inputs: &[Self::Tensor], ) -> Result<Self::Tensor, Self::Error>
Execute an einsum operation on input tensors.
Source§fn elem_op(
&mut self,
op: ElemOp,
x: &Self::Tensor,
) -> Result<Self::Tensor, Self::Error>
fn elem_op( &mut self, op: ElemOp, x: &Self::Tensor, ) -> Result<Self::Tensor, Self::Error>
Apply an element-wise unary operation.
Auto Trait Implementations§
impl Freeze for ParallelScirs2Exec
impl RefUnwindSafe for ParallelScirs2Exec
impl Send for ParallelScirs2Exec
impl Sync for ParallelScirs2Exec
impl Unpin for ParallelScirs2Exec
impl UnwindSafe for ParallelScirs2Exec
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> 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>
Converts
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>
Converts
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 more