예제 #1
0
파일: __init__.py 프로젝트: zhisbug/ludwig
def create_backend(name, **kwargs):
    if isinstance(name, Backend):
        return name

    if name is None and has_horovodrun():
        name = HOROVOD

    return backend_registry[name](**kwargs)
예제 #2
0
def create_backend(backend):
    if isinstance(backend, Backend):
        return backend

    if backend is None and has_horovodrun():
        backend = HOROVOD

    return backend_registry[backend]()
예제 #3
0
def create_backend(type, **kwargs):
    if isinstance(type, Backend):
        return type

    if type is None and _has_ray():
        type = RAY
    elif type is None and has_horovodrun():
        type = HOROVOD

    return backend_registry[type](**kwargs)