pub struct DDIMScheduler {
pub config: DDIMSchedulerConfig,
/* private fields */
}
Expand description
The DDIM scheduler.
Fields§
§config: DDIMSchedulerConfig
Implementations§
Source§impl DDIMScheduler
impl DDIMScheduler
Sourcepub fn new(inference_steps: usize, config: DDIMSchedulerConfig) -> Self
pub fn new(inference_steps: usize, config: DDIMSchedulerConfig) -> Self
Creates a new DDIM scheduler given the number of steps to be used for inference as well as the number of steps that was used during training.
pub fn timesteps(&self) -> &[usize]
Sourcepub fn scale_model_input(&self, sample: Tensor, _timestep: usize) -> Tensor
pub fn scale_model_input(&self, sample: Tensor, _timestep: usize) -> Tensor
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep.
Sourcepub fn step(
&self,
model_output: &Tensor,
timestep: usize,
sample: &Tensor,
) -> Tensor
pub fn step( &self, model_output: &Tensor, timestep: usize, sample: &Tensor, ) -> Tensor
Performs a backward step during inference.
pub fn add_noise( &self, original: &Tensor, noise: Tensor, timestep: usize, ) -> Tensor
pub fn init_noise_sigma(&self) -> f64
Trait Implementations§
Source§impl Clone for DDIMScheduler
impl Clone for DDIMScheduler
Source§fn clone(&self) -> DDIMScheduler
fn clone(&self) -> DDIMScheduler
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 moreAuto Trait Implementations§
impl Freeze for DDIMScheduler
impl RefUnwindSafe for DDIMScheduler
impl Send for DDIMScheduler
impl Sync for DDIMScheduler
impl Unpin for DDIMScheduler
impl UnwindSafe for DDIMScheduler
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