f43e34a990ef0f9bfa6ac055c79a2f62c6b6b322,mushroom_rl/core/serialization.py,Serializable,save,#Serializable#Any#Any#,17

Before Change


            self._save_pickle(zip_file, "config", agent_config)

            for att, method in self._save_attributes.items():
                attribute = getattr(self, att) if hasattr(self, att) else None

                if attribute is not None:
                    if hasattr(self, "_save_{}".format(method)):
                        save_method = getattr(self, "_save_{}".format(method))
                        file_name = "{}.{}".format(att, method)
                        save_method(zip_file, file_name, attribute, full_save=full_save)
                    else:
                        raise NotImplementedError(
                            "Method _save_{} is not implemented for class "{}"".
                                format(method, self.__class__.__name__)
                        )

    @classmethod
    def load(cls, path):
        
        Load and deserialize the agent from the given location on disk.

After Change


        path = Path(path)
        path.parent.mkdir(parents=True, exist_ok=True)

        with ZipFile(path, "w") as zip_file:
            self.save_zip(zip_file, full_save)
        print("-------------------------------------------------------------------------------------------------------")

    def save_zip(self, zip_file, full_save, folder=""):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: AIRLab-POLIMI/mushroom
Commit Name: f43e34a990ef0f9bfa6ac055c79a2f62c6b6b322
Time: 2020-04-22
Author: boris.ilpossente@hotmail.it
File Name: mushroom_rl/core/serialization.py
Class Name: Serializable
Method Name: save


Project Name: AIRLab-POLIMI/mushroom
Commit Name: f43e34a990ef0f9bfa6ac055c79a2f62c6b6b322
Time: 2020-04-22
Author: boris.ilpossente@hotmail.it
File Name: mushroom_rl/core/serialization.py
Class Name: Serializable
Method Name: load


Project Name: AIRLab-POLIMI/mushroom
Commit Name: f43e34a990ef0f9bfa6ac055c79a2f62c6b6b322
Time: 2020-04-22
Author: boris.ilpossente@hotmail.it
File Name: mushroom_rl/core/serialization.py
Class Name: Serializable
Method Name: save


Project Name: tensorflow/transform
Commit Name: 96e4af6e86e93da021c29a4273dcdfaeab8fdfcf
Time: 2017-08-07
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/beam/impl.py
Class Name: _RunMetaGraphDoFn
Method Name: process