engine.py 285 字节
Newer Older
T
tangwei 已提交
1 2 3 4 5 6 7 8 9
import abc


class Engine:
    __metaclass__ = abc.ABCMeta

    def __init__(self, envs, trainer):
        self.envs = envs
        self.trainer = trainer
T
tangwei 已提交
10 11 12 13
        self.__init_impl__()

    def __init_impl__(self):
        pass
T
tangwei 已提交
14 15 16 17

    @abc.abstractmethod
    def run(self):
        pass
T
tangwei 已提交
18