shared_lib.py 文件源码

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

项目:AVSR-Deep-Speech 作者: pandeydivesh15 项目源码 文件源码
def check_so(soname):
    """
    Verify that we do have the 'soname' lib present in the system, and that it
    can be loaded.
    """

    if len(get_available_gpus()) == 0:
        return None

    # Try to force load lib, this would fail if the lib is not there :)
    try:
        lib = cdll.LoadLibrary(soname)
        print("INFO: Found so as", lib)
        assert lib.__class__.__name__ == 'CDLL'
        assert lib._name == soname
        return True
    except OSError as ex:
        print("WARNING:", ex)
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号