def _adjust_pipeline_resource(self, pipeline_opt, dataset, pipeline_num):
    filelist_length = len(dataset.dataset.get_filelist())
    if (filelist_length < pipeline_num):
        pipeline_num = filelist_length
        print(('Pipeline training: setting the pipeline num to %d is enough because there are only %d files' % (filelist_length, filelist_length)))
    if (filelist_length < (pipeline_num * pipeline_opt['concurrency_list'][0])):
        print(('Pipeline training: setting the 1st element in concurrency_list to %d is enough because there are only %d files' % ((filelist_length // pipeline_num), filelist_length)))
        pipeline_opt['concurrency_list'][0] = (filelist_length // pipeline_num)
    dataset.set_thread((pipeline_opt['concurrency_list'][0] * pipeline_num))
    return pipeline_num
def _adjust_pipeline_resource(self, pipeline_opt, dataset, pipeline_num):
    filelist_length = len(dataset.dataset.get_filelist())
    if (filelist_length < pipeline_num):
        pipeline_num = filelist_length
        print(('Pipeline training: setting the pipeline num to %d is enough because there are only %d files' % (filelist_length, filelist_length)))
    if (filelist_length < (pipeline_num * pipeline_opt['concurrency_list'][0])):
        print(('Pipeline training: setting the 1st element in concurrency_list to %d is enough because there are only %d files' % ((filelist_length // pipeline_num), filelist_length)))
        pipeline_opt['concurrency_list'][0] = (filelist_length // pipeline_num)
    dataset.set_thread((pipeline_opt['concurrency_list'][0] * pipeline_num))
    return pipeline_num