def register_model(self, name='model', model=None, optim=None, sched=None):
    if (self.__dict__.get('_models') is None):
        raise AttributeError('Cannot assign model before super().__init__() call')
    if (self.__dict__.get('_optims') is None):
        raise AttributeError('Cannot assign optim before super().__init__() call')
    if (self.__dict__.get('_scheds') is None):
        raise AttributeError('Cannot assign sched before super().__init__() call')
    assert (name not in self._models), 'Found duplicate model names'
    self._models[name] = model
    self._optims[name] = optim
    self._scheds[name] = sched
def register_model(self, name='model', model=None, optim=None, sched=None):
    if (self.__dict__.get('_models') is None):
        raise AttributeError('Cannot assign model before super().__init__() call')
    if (self.__dict__.get('_optims') is None):
        raise AttributeError('Cannot assign optim before super().__init__() call')
    if (self.__dict__.get('_scheds') is None):
        raise AttributeError('Cannot assign sched before super().__init__() call')
    assert (name not in self._models), 'Found duplicate model names'
    self._models[name] = model
    self._optims[name] = optim
    self._scheds[name] = sched