MCPcopy Create free account
hub / github.com/PythonOT/POT / get_backend_list

Function get_backend_list

ot/backend.py:190–204  ·  view source on GitHub ↗

Returns instances of all available backends. Note that the function forces all detected implementations to be instantiated even if specific backend was not use before. Be careful as instantiation of the backend might lead to side effects, like GPU memory pre-allocation. See the docu

()

Source from the content-addressed store, hash-verified

188
189
190def get_backend_list():
191 """Returns instances of all available backends.
192
193 Note that the function forces all detected implementations
194 to be instantiated even if specific backend was not use before.
195 Be careful as instantiation of the backend might lead to side effects,
196 like GPU memory pre-allocation. See the documentation for more details.
197 If you only need to know which implementations are available,
198 use `:py:func:`ot.backend.get_available_backend_implementations`,
199 which does not force instance of the backend object to be created.
200 """
201 return [
202 _get_backend_instance(backend_impl)
203 for backend_impl in get_available_backend_implementations()
204 ]
205
206
207def get_available_backend_implementations():

Callers 3

test_get_backend_listFunction · 0.90
conftest.pyFile · 0.90
exec_benchFunction · 0.90

Calls 2

_get_backend_instanceFunction · 0.85

Tested by 1

test_get_backend_listFunction · 0.72