Skip to content
FastVideo
Esc
↑↓navigate↵open⌘Jpreview
On this page

base

fastvideo.models.schedulers.base.BaseScheduler

BaseScheduler(*args, **kwargs)
Source
class BaseScheduler(ABC):
    timesteps: torch.Tensor
    order: int
    num_train_timesteps: int
def __init__(self, *args, **kwargs) -> None:
    # Check if subclass has defined all required properties
    required_attributes = ['timesteps', 'order', 'num_train_timesteps']

    for attr in required_attributes:
        if not hasattr(self, attr):
            raise AttributeError(f"Subclasses of BaseScheduler must define '{attr}' property")

@abstractmethod
def set_shift(self, shift: float) -> None:
    pass

@abstractmethod
def set_timesteps(self, *args, **kwargs) -> None:
    pass

@abstractmethod
def scale_model_input(self, sample: torch.Tensor, timestep: int | None = None) -> torch.Tensor:
    pass</code></pre></details>

fastvideo.models.schedulers.base.BaseScheduler.set_shift

set_shift(shift: float) -> None
Source
@abstractmethod
def set_shift(self, shift: float) -> None:
    pass

fastvideo.models.schedulers.base.BaseScheduler.set_timesteps

set_timesteps(*args, **kwargs) -> None
Source
@abstractmethod
def set_timesteps(self, *args, **kwargs) -> None:
    pass

fastvideo.models.schedulers.base.BaseScheduler.scale_model_input

scale_model_input(sample: torch.Tensor, timestep: int | None = None) -> torch.Tensor
Source
@abstractmethod
def scale_model_input(self, sample: torch.Tensor, timestep: int | None = None) -> torch.Tensor:
    pass

Was this page helpful?