Esempio n. 1
0
    def return_global_model(self):
        """
        Serializes the current global torch model and sends it back to the worker.

        Returns
        ----------

        dict:
            The model dictionary as per the specification in DCFSever
        """
        logger.info(f"Example Global Model: returning global model")
        model_data = io.BytesIO()
        torch.save(self.global_model, model_data)
        return create_model_dict(model_data.getvalue(),
                                 self.global_model_version)
Esempio n. 2
0
 def test_ret_global_model_cb():
     return create_model_dict(msgpack.packb("Pickle dump of a string"),
                              global_model_version)