0f7823cb6a27b5d7dfab56f06a6601bf2957594b,skorch/net.py,NeuralNet,__setstate__,#NeuralNet#Any#,1320

Before Change


                        not torch.cuda.is_available()
                ):
                    disable_cuda = True
                    val = torch.load(
                        f, map_location=lambda storage, loc: storage)
                else:
                    val = torch.load(f)
            state[key] = val
        if disable_cuda:

After Change


                        not torch.cuda.is_available())
        load_kwargs = {}
        if disable_cuda:
            load_kwargs = {"map_location": lambda store, loc: store}

        with tempfile.SpooledTemporaryFile() as f:
            f.write(state["cuda_dependent_attributes_"])
            f.seek(0)
            cuda_attrs = torch.load(f, **load_kwargs)

        set_cuda_attrs = {}
        state.update(cuda_attrs)
        for key in self.cuda_dependent_attributes_:
            if key not in cuda_attrs:
                continue
            set_cuda_attrs[key] = state.pop(key)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dnouri/skorch
Commit Name: 0f7823cb6a27b5d7dfab56f06a6601bf2957594b
Time: 2018-08-23
Author: stsievert@users.noreply.github.com
File Name: skorch/net.py
Class Name: NeuralNet
Method Name: __setstate__


Project Name: MycroftAI/mycroft-precise
Commit Name: 94d3087bbb0e49941aa349574f8298917f074452
Time: 2020-04-30
Author: matthew331199@gmail.com
File Name: precise/scripts/train_optimize.py
Class Name: TrainOptimizeScript
Method Name: __init__


Project Name: deepmipt/DeepPavlov
Commit Name: 0d3211379b2faabfa05495c4b4ca61e1a309383d
Time: 2018-07-24
Author: yoptar@gmail.com
File Name: deeppavlov/models/seq2seq_go_bot/kb.py
Class Name: KnowledgeBase
Method Name: load