def extract(self, model, data_loader, distributed=False):
    model.eval()
    func = (lambda **x: self._forward_func(model, **x))
    if distributed:
        (rank, world_size) = get_dist_info()
        results = dist_forward_collect(func, data_loader, rank, len(data_loader.dataset))
    else:
        results = nondist_forward_collect(func, data_loader, len(data_loader.dataset))
    return results
def extract(self, model, data_loader, distributed=False):
    model.eval()
    func = (lambda **x: self._forward_func(model, **x))
    if distributed:
        (rank, world_size) = get_dist_info()
        results = dist_forward_collect(func, data_loader, rank, len(data_loader.dataset))
    else:
        results = nondist_forward_collect(func, data_loader, len(data_loader.dataset))
    return results