60dfcf812eca79017dced46e1189245c050a3fd6,utils/factory.py,UtilsFactory,unpack_checkpoint,#Any#Any#Any#Any#Any#,241

Before Change



        if scheduler is not None:
            for key in scheduler:
                scheduler[key] = checkpoint["scheduler_" + str(key)]

After Change


            else:
                model.load_state_dict(checkpoint["model_state_dict"])

        for dict2load, name2load in zip(
                [criterion, optimizer, scheduler],
                ["criterion", "optimizer", "scheduler"]):
            if dict2load is None:
                continue

            if isinstance(dict2load, dict):
                for key, value in dict2load.items():
                    if value is not None:
                        name2load_ = f"{name2load}_{key}_state_dict"
                        value.load_state_dict(checkpoint[name2load_])
            else:
                name2load = f"{name2load}_state_dict"
                dict2load.load_state_dict(checkpoint[name2load])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: Scitator/catalyst
Commit Name: 60dfcf812eca79017dced46e1189245c050a3fd6
Time: 2018-12-10
Author: scitator@gmail.com
File Name: utils/factory.py
Class Name: UtilsFactory
Method Name: unpack_checkpoint


Project Name: andresriancho/w3af
Commit Name: b2dd110beac2001b5544126c84b0493467ae7f1c
Time: 2017-08-23
Author: andres.riancho@gmail.com
File Name: w3af/core/data/request/fuzzable_request.py
Class Name: FuzzableRequest
Method Name: sent


Project Name: deepchem/deepchem
Commit Name: 03ef391a07e08eefce7299f3a934b49505c5be16
Time: 2017-03-06
Author: lilleswing@gmail.com
File Name: examples/pdbbind/pdbbind_datasets.py
Class Name:
Method Name: featurize_pdbbind