communication_utils.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:OwlPy 作者: mateuszzwierzycki 项目源码 文件源码
def get_available_gpus():
    local_device_protos = device_lib.list_local_devices()

    values = ""
    counter = 0
    length = len(local_device_protos)

    for device in local_device_protos:
        if device.device_type == "GPU":
            description = "Found " + device.physical_device_desc
            values += description
            if counter < length - 1: values += "\n"
        counter += 1

    # return [x.name for x in local_device_protos if x.device_type == 'GPU']
    return values


# this is taken from the C++ header file
# const int INFO = 0;            // base_logging::INFO;
# const int WARNING = 1;         // base_logging::WARNING;
# const int ERROR = 2;           // base_logging::ERROR;
# const int FATAL = 3;           // base_logging::FATAL;
# const int NUM_SEVERITIES = 4;  // base_logging::NUM_SEVERITIES;
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号