61781b939bfaad37bc4ff506cd52183748e0de0d,pycorrector/seq2seq/train.py,,train,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,22

Before Change


        os.environ["CUDA_VISIBLE_DEVICES"] = str(config.gpu_id)
        if torch.cuda.is_available():
            device = torch.device("cuda:{}".format(gpu_id))
            torch.cuda.set_device(gpu_id)
        else:
            device = torch.device("cpu")
    else:
        device = torch.device("cpu")

After Change


    if gpu_id > -1:
        os.environ["CUDA_VISIBLE_DEVICES"] = str(config.gpu_id)
        if torch.cuda.is_available():
            device = torch.device("cuda")
        else:
            device = torch.device("cpu")
    else:
        device = torch.device("cpu")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: shibing624/pycorrector
Commit Name: 61781b939bfaad37bc4ff506cd52183748e0de0d
Time: 2019-07-19
Author: 507153809@qq.com
File Name: pycorrector/seq2seq/train.py
Class Name:
Method Name: train


Project Name: naoto0804/pytorch-AdaIN
Commit Name: 4a5eef64d2a0ab5e1737ffbb345d9e72d2f1adc9
Time: 2018-05-16
Author: inoue@hal.t.u-tokyo.ac.jp
File Name: train.py
Class Name:
Method Name:


Project Name: naoto0804/pytorch-AdaIN
Commit Name: 4a5eef64d2a0ab5e1737ffbb345d9e72d2f1adc9
Time: 2018-05-16
Author: inoue@hal.t.u-tokyo.ac.jp
File Name: test.py
Class Name:
Method Name: