pub struct StepContext {
pub plan: Digest,
pub step_index: u32,
pub sigma_from: f32,
pub sigma_to: f32,
pub tensor: TensorSpec,
}Expand description
Exact post-step state boundary presented to Rust.
Fields§
§plan: DigestExact execution-plan identity.
step_index: u32Zero-based transition that just completed.
sigma_from: f32Sigma before the transition.
sigma_to: f32Sigma after the transition.
tensor: TensorSpecTensor contract at this boundary.
Implementations§
Source§impl StepContext
impl StepContext
Sourcepub fn for_plan(
plan: &DiffusionPlan,
step_index: usize,
) -> Result<Self, CoreError>
pub fn for_plan( plan: &DiffusionPlan, step_index: usize, ) -> Result<Self, CoreError>
Creates the exact post-step context for one plan transition.
§Errors
Returns an error when the plan or index is invalid.
Sourcepub fn validate_for(&self, plan: &DiffusionPlan) -> Result<(), CoreError>
pub fn validate_for(&self, plan: &DiffusionPlan) -> Result<(), CoreError>
Validates this boundary against its complete execution plan.
§Errors
Returns an error for an identity, index, sigma, or tensor mismatch.
Trait Implementations§
Source§impl Clone for StepContext
impl Clone for StepContext
Source§impl Debug for StepContext
impl Debug for StepContext
Source§impl<'de> Deserialize<'de> for StepContext
impl<'de> Deserialize<'de> for StepContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StepContext
impl PartialEq for StepContext
Source§impl Serialize for StepContext
impl Serialize for StepContext
impl StructuralPartialEq for StepContext
Auto Trait Implementations§
impl Freeze for StepContext
impl RefUnwindSafe for StepContext
impl Send for StepContext
impl Sync for StepContext
impl Unpin for StepContext
impl UnsafeUnpin for StepContext
impl UnwindSafe for StepContext
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