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
()
| 188 | |
| 189 | |
| 190 | def 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 | |
| 207 | def get_available_backend_implementations(): |