f881b0d7401eb9cd1c49dbffdaad5c4f911c0b45,inferno/trainers/basic.py,Trainer,save,#Trainer#Any#Any#,1254

Before Change


        self._last_saved_at_epoch = self._epoch_count
        // Save the state dictionary
        torch.save(self.get_config(exclude_loader=exclude_loader),
                   os.path.join(self._save_to_directory, "checkpoint.pytorch"),
                   pickle_module=dill)
        if self._is_iteration_with_best_validation_score and stash_best_checkpoint:
            // Do the stashin"

After Change



        if self._is_iteration_with_best_validation_score and stash_best_checkpoint:
            // Do the stashin"
            shutil.copyfile(self._fname_checkpoint, self._fname_best)

        // This is required to prevent an infinite save loop?
        self._is_iteration_with_best_validation_score = False
        self.print("Saved to {}.".format(self._save_to_directory))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: inferno-pytorch/inferno
Commit Name: f881b0d7401eb9cd1c49dbffdaad5c4f911c0b45
Time: 2017-08-17
Author: sven.peter@iwr.uni-heidelberg.de
File Name: inferno/trainers/basic.py
Class Name: Trainer
Method Name: save


Project Name: matplotlib/matplotlib
Commit Name: 93aad5fa0a7a030f458ab5dc1a541fe8da1933c2
Time: 2019-09-13
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/tests/test_compare_images.py
Class Name:
Method Name: test_image_comparison_expect_rms


Project Name: invesalius/invesalius3
Commit Name: a21f0c3764214fc0171dccea0459695f157f478e
Time: 2011-12-28
Author: totonixsame@gmail.com
File Name: invesalius/project.py
Class Name: Project
Method Name: SavePlistProject