graph_runner.py 447 Bytes
Newer Older
root's avatar
root committed
1
from loguru import logger
2

PengGao's avatar
PengGao committed
3
4
from lightx2v.utils.profiler import ProfilingContext4Debug

5
6
7
8
9
10
11

class GraphRunner:
    def __init__(self, runner):
        self.runner = runner
        self.compile()

    def compile(self):
root's avatar
root committed
12
        logger.info("start compile...")
13
14
        with ProfilingContext4Debug("compile"):
            self.runner.run_step()
root's avatar
root committed
15
        logger.info("end compile...")
16

helloyongyang's avatar
helloyongyang committed
17
18
    def run_pipeline(self):
        return self.runner.run_pipeline()