Skip to content

[Q] Possibly unused self.final_alpha_cumprod #9395

Open
@fdtomasi

Description

@fdtomasi

Hello team, quick question to make sure I understand the behavior of the step function in LCM Scheduler.

# 1. get previous step value
prev_step_index = self.step_index + 1
if prev_step_index < len(self.timesteps):
prev_timestep = self.timesteps[prev_step_index]
else:
prev_timestep = timestep
# 2. compute alphas, betas
alpha_prod_t = self.alphas_cumprod[timestep]
alpha_prod_t_prev = self.alphas_cumprod[prev_timestep] if prev_timestep >= 0 else self.final_alpha_cumprod

Here, it seems that the condition prev_timestep >= 0 is always True, because timestep and self.timesteps[prev_step_index] cannot be negative. This would mean that self.final_alpha_cumprod is never used. Is there a way in which prev_timestep can be negative?

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions