bf7b72bb1652ec36a335fa7a09a0423453766e8a,ludwig/utils/tf_utils.py,,get_available_gpus,#,96

Before Change



def get_available_gpus():
    local_device_protos = device_lib.list_local_devices()
    return [x.name[-1] for x in local_device_protos if x.device_type == "GPU"]

After Change




def get_available_gpus():
    gpus_list_queue = Queue()
    proc_get_gpus = Process(
        target=get_available_gpus_child_process, args=(gpus_list_queue,))
    proc_get_gpus.start()
    proc_get_gpus.join()
    gpus_list = gpus_list_queue.get()
    return gpus_list
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: uber/ludwig
Commit Name: bf7b72bb1652ec36a335fa7a09a0423453766e8a
Time: 2020-07-17
Author: kaushikbokka@gmail.com
File Name: ludwig/utils/tf_utils.py
Class Name:
Method Name: get_available_gpus


Project Name: deepchem/deepchem
Commit Name: 86328d567ff862262e0da70d0ebc9d90b407e03a
Time: 2017-11-29
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/tensor_graph.py
Class Name: TensorGraph
Method Name: predict_on_generator


Project Name: HazyResearch/fonduer
Commit Name: 1c0cd03712f95fb5966968abc2a39313175594c6
Time: 2018-09-07
Author: jrausch@inf.ethz.ch
File Name: src/fonduer/utils/udf.py
Class Name: UDFRunner
Method Name: apply_mt