data_loader.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:MLUtil 作者: WarBean 项目源码 文件源码
def __init__(self, config):
        default_config = Config(proc_count = 4, limit_batch_count = None)
        self.config = default_config(**config)
        self.exit = Event()
        self.batch_queue = Queue(maxsize = 10)
        if self.config.limit_batch_count is None:
            self.limited = False
        else:
            self.limited = True
            self.batch_list = []
            self.index = -1
        self.workers = []
        for _ in range(self.config.proc_count):
            self.workers.append(Process(target = config.worker, args = (self,)))
        for w in self.workers:
            w.daemon = True
            w.start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号