scheduler.py 560 Bytes
Newer Older
gushiqiao's avatar
gushiqiao committed
1
from lightx2v.utils.envs import *
helloyongyang's avatar
helloyongyang committed
2
3


Dongz's avatar
Dongz committed
4
class BaseScheduler:
helloyongyang's avatar
helloyongyang committed
5
6
    def __init__(self, config):
        self.config = config
helloyongyang's avatar
helloyongyang committed
7
        self.latents = None
Rongjin Yang's avatar
Rongjin Yang committed
8
        self.step_index = 0
9
10
        self.infer_steps = config.infer_steps
        self.caching_records = [True] * config.infer_steps
11
        self.flag_df = False
12
        self.transformer_infer = None
Dongz's avatar
Dongz committed
13

helloyongyang's avatar
helloyongyang committed
14
15
    def step_pre(self, step_index):
        self.step_index = step_index
16
17
        if GET_DTYPE() == GET_SENSITIVE_DTYPE():
            self.latents = self.latents.to(GET_DTYPE())
18
19
20

    def clear(self):
        pass