pub struct PreparedStructuralMultiphase { /* private fields */ }Expand description
Reusable native scheduler for ordered structural phase models.
Implementations§
Source§impl PreparedStructuralMultiphase
impl PreparedStructuralMultiphase
Sourcepub fn new(
models: Vec<PreparedStructuralModel>,
execution: ExecutionPolicy,
) -> Result<Self, StructuralMultiphaseError>
pub fn new( models: Vec<PreparedStructuralModel>, execution: ExecutionPolicy, ) -> Result<Self, StructuralMultiphaseError>
Prepare a non-empty ordered phase collection.
§Errors
Returns StructuralMultiphaseError::EmptyPhases for an empty model list.
Sourcepub fn phase_count(&self) -> usize
pub fn phase_count(&self) -> usize
Return the number of prepared phases.
Sourcepub fn structural_parameter_counts(&self) -> Vec<usize>
pub fn structural_parameter_counts(&self) -> Vec<usize>
Return structural parameter counts in phase order.
Sourcepub fn calculate(
&self,
inputs: &[PreparedStructuralModelInputView<'_>],
) -> Result<StructuralMultiphaseResult, StructuralMultiphaseError>
pub fn calculate( &self, inputs: &[PreparedStructuralModelInputView<'_>], ) -> Result<StructuralMultiphaseResult, StructuralMultiphaseError>
Calculate all phases and their ordered sum.
§Errors
Returns StructuralMultiphaseError for invalid inputs or phase failures.
Sourcepub fn calculate_request(
&self,
request: StructuralCalculationRequest,
) -> Result<StructuralCalculationResult, StructuralMultiphaseError>
pub fn calculate_request( &self, request: StructuralCalculationRequest, ) -> Result<StructuralCalculationResult, StructuralMultiphaseError>
Calculate from an entirely owned application-boundary request.
This is the shared entry point for language and application adapters. The request owns all dynamic arrays; kernel views exist only for the duration of this call.
§Errors
Returns StructuralMultiphaseError for invalid inputs or phase failures.
Sourcepub fn linearize(
&self,
inputs: &[PreparedStructuralModelInputView<'_>],
) -> Result<Vec<StructuralPatternDenseResult>, StructuralMultiphaseError>
pub fn linearize( &self, inputs: &[PreparedStructuralModelInputView<'_>], ) -> Result<Vec<StructuralPatternDenseResult>, StructuralMultiphaseError>
Calculate one dense structural linearization per phase.
§Errors
Returns StructuralMultiphaseError for invalid inputs or phase failures.
Sourcepub fn jvp(
&self,
inputs: &[PreparedStructuralModelInputView<'_>],
tangents: &[&[f64]],
) -> Result<Vec<StructuralPatternJvpResult>, StructuralMultiphaseError>
pub fn jvp( &self, inputs: &[PreparedStructuralModelInputView<'_>], tangents: &[&[f64]], ) -> Result<Vec<StructuralPatternJvpResult>, StructuralMultiphaseError>
Calculate one structural forward product per phase.
§Errors
Returns StructuralMultiphaseError for invalid inputs or tangents.
Sourcepub fn vjp(
&self,
inputs: &[PreparedStructuralModelInputView<'_>],
sample_weights: &[f64],
) -> Result<Vec<StructuralPatternVjpResult>, StructuralMultiphaseError>
pub fn vjp( &self, inputs: &[PreparedStructuralModelInputView<'_>], sample_weights: &[f64], ) -> Result<Vec<StructuralPatternVjpResult>, StructuralMultiphaseError>
Calculate one structural reverse product per phase.
§Errors
Returns StructuralMultiphaseError for invalid inputs or sample weights.
Auto Trait Implementations§
impl !RefUnwindSafe for PreparedStructuralMultiphase
impl !UnwindSafe for PreparedStructuralMultiphase
impl Freeze for PreparedStructuralMultiphase
impl Send for PreparedStructuralMultiphase
impl Sync for PreparedStructuralMultiphase
impl Unpin for PreparedStructuralMultiphase
impl UnsafeUnpin for PreparedStructuralMultiphase
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
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 more