def test_set_obj_train_config(): fed_client = FederatedClient() fed_client.optimizer = True train_config = TrainConfig(id=100, model=None, loss_fn=None) fed_client.set_obj(train_config) assert fed_client.train_config.id == train_config.id assert fed_client.optimizer is None
def set_train_config(self, *args, **kwargs): config = TrainConfig(*args, **kwargs) self._train_config_ptr = config.send(self)