0a3c1aa4d67cb9c49f22a87bef180c07dfafec8a,testing/get_gpu_index.py,,,#,5

Before Change


import subprocess

rc = subprocess.call("/home/wenqi/list_gpu_memory.sh", shell=True)
gpu_info = []
with open("./gpu_tmp_log", "r") as f:
    for line in f.readlines():
        gpu_info.append(line[:-1])
free_memory = [float(x) for x in gpu_info[1:]]
if free_memory[0] > 1000:
    print("1")
else:

After Change


p3 = Popen(["sed", "s: MiB::"], stdin=p2.stdout, stdout=PIPE)
output, error = p3.communicate()

free_memory = [float(x) for x in output.split("\n")[:-1]]
if free_memory[0] > 1000:
    print("1")
else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: NifTK/NiftyNet
Commit Name: 0a3c1aa4d67cb9c49f22a87bef180c07dfafec8a
Time: 2017-06-16
Author: wenqi.li@ucl.ac.uk
File Name: testing/get_gpu_index.py
Class Name:
Method Name:


Project Name: NifTK/NiftyNet
Commit Name: aa495c2ace9444aa5028f699ae62dddef45ab7d9
Time: 2017-06-15
Author: wenqi.li@ucl.ac.uk
File Name: testing/get_gpu_index.py
Class Name:
Method Name:


Project Name: Netflix/vmaf
Commit Name: e485b12acb290ba9bd7670179144e92ffd31d0bc
Time: 2016-02-12
Author: zli@netflix.com
File Name: python/vmaf_quality_runner.py
Class Name: VmafQualityRunner
Method Name: _get_quality_scores