def __init__(self, config, model, train_loader, test_loader=None, device=None):
        """ Base Trainer class for training a model."""
        
        self.config = config
        self.metric_criterion = "abs_rel"
        if device is None:
            device = torch.device(
                'cuda') if torch.cuda.is_available() else torch.device('cpu')
        self.device = device
        self.model = model
        self.train_loader = train_loader
        self.test_loader = test_loader
        self.optimizer = self.init_optimizer()
        self.scheduler = self.init_scheduler()
 Base Trainer class for training a model.
ControlNet-v1-1-nightly/annotator/zoe/zoedepth/trainers/base_trainer.py