3825e99ee36bd237d11f702af93a2acba4496c9b,utils/torch_utils.py,,select_device,#Any#,10

Before Change


        device = torch.device("cuda:0" if cuda else "cpu")

        if torch.cuda.device_count() > 1:
            device = torch.device("cuda" if cuda else "cpu")
            print("Found %g GPUs" % torch.cuda.device_count())
            // print("Multi-GPU Issue: https://github.com/ultralytics/yolov3/issues/21")
            // torch.cuda.set_device(0)  // OPTIONAL: Set your GPU if multiple available
            // print("Using ", torch.cuda.device_count(), " GPUs")

After Change


              (x[0].name, x[0].total_memory / c))
        if ng > 0:
            // torch.cuda.set_device(0)  // OPTIONAL: Set GPU ID
            for i in range(1, ng):
                print("           device%g _CudaDeviceProperties(name="%s", total_memory=%dMB)" %
                      (i, x[i].name, x[i].total_memory / c))

    return device
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: ultralytics/yolov3
Commit Name: 3825e99ee36bd237d11f702af93a2acba4496c9b
Time: 2019-04-08
Author: glenn.jocher@ultralytics.com
File Name: utils/torch_utils.py
Class Name:
Method Name: select_device


Project Name: THUNLP-MT/THUMT
Commit Name: 4af72126c388385371b1235d1336c1ef98723326
Time: 2019-04-30
Author: playinf@stu.xmu.edu.cn
File Name: thumt/utils/parallel.py
Class Name:
Method Name: shard_features


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