    def predict_loop(self, model, eval_dataloader, output_file=None):
        """TODO: refactor base classes."""
        ctx = 0
        outputs = {"outputs": [], "targets": [[]]}
        model.eval()
        model = model.to(ctx)
        with torch.no_grad():
            for data in tqdm(eval_dataloader):
                data = self.to_ctx(data, ctx)
                self(data, model, outputs)
        return self.finalize(outputs, output_file)
TODO: refactor base classes.
examples/MMPT/mmpt/evaluators/predictor.py