INNER CODE UNIT · Python
full_path
bytedance/byteps · byteps/common/__init__.py:40
full_path = os.path.join(dir_path, args[-1] + get_ext_suffix())
return full_path
def check_extension(ext_name, ext_env_var, pkg_path, *args):
full_path = get_extension_full_path(pkg_path, *args)
if not os.path.exists(full_path):
raise ImportError(
'Extension %s has not been built. If this is not expected, reinstall '
'BytePS with %s=1 to debug the build error.' % (ext_name, ext_env_var))
class BytePSBasics(object):
"""Wrapper class for the basic BytePS API."""
def __init__(self, pkg_path, *args):
full_path = get_extension_full_path(pkg_path, *args)
self.C_LIB_CTYPES = ctypes.CDLL(full_path, mode=ctypes.RTLD_GLOBAL)