Struct candle_transformers::models::stable_diffusion::euler_ancestral_discrete::EulerAncestralDiscreteScheduler
source · pub struct EulerAncestralDiscreteScheduler {
pub config: EulerAncestralDiscreteSchedulerConfig,
/* private fields */
}
Expand description
The EulerAncestral Discrete scheduler.
Fields§
§config: EulerAncestralDiscreteSchedulerConfig
Implementations§
source§impl EulerAncestralDiscreteScheduler
impl EulerAncestralDiscreteScheduler
sourcepub fn new(
inference_steps: usize,
config: EulerAncestralDiscreteSchedulerConfig
) -> Result<Self>
pub fn new( inference_steps: usize, config: EulerAncestralDiscreteSchedulerConfig ) -> Result<Self>
Creates a new EulerAncestral Discrete scheduler given the number of steps to be used for inference as well as the number of steps that was used during training.
Trait Implementations§
source§impl Clone for EulerAncestralDiscreteScheduler
impl Clone for EulerAncestralDiscreteScheduler
source§fn clone(&self) -> EulerAncestralDiscreteScheduler
fn clone(&self) -> EulerAncestralDiscreteScheduler
Returns a copy 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 Scheduler for EulerAncestralDiscreteScheduler
impl Scheduler for EulerAncestralDiscreteScheduler
source§fn scale_model_input(&self, sample: Tensor, timestep: usize) -> Result<Tensor>
fn scale_model_input(&self, sample: Tensor, timestep: usize) -> Result<Tensor>
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep.
Scales the denoising model input by (sigma**2 + 1) ** 0.5
to match the K-LMS algorithm
source§fn step(
&self,
model_output: &Tensor,
timestep: usize,
sample: &Tensor
) -> Result<Tensor>
fn step( &self, model_output: &Tensor, timestep: usize, sample: &Tensor ) -> Result<Tensor>
Performs a backward step during inference.
fn timesteps(&self) -> &[usize]
fn add_noise( &self, original: &Tensor, noise: Tensor, timestep: usize ) -> Result<Tensor>
fn init_noise_sigma(&self) -> f64
Auto Trait Implementations§
impl Freeze for EulerAncestralDiscreteScheduler
impl RefUnwindSafe for EulerAncestralDiscreteScheduler
impl Send for EulerAncestralDiscreteScheduler
impl Sync for EulerAncestralDiscreteScheduler
impl Unpin for EulerAncestralDiscreteScheduler
impl UnwindSafe for EulerAncestralDiscreteScheduler
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