MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_local_backend

Function get_local_backend

tensorflow/compiler/xla/python/xla_client.py:242–260  ·  view source on GitHub ↗

Returns a local backend. Args: name: the backend name. If `None`, a default local backend is returned, typically `gpu` if one is present, or `cpu` if not. If a string, the named backend is returned or an exception raised. Returns: A LocalBackend object.

(name=None)

Source from the content-addressed store, hash-verified

240
241
242def get_local_backend(name=None):
243 """Returns a local backend.
244
245 Args:
246 name: the backend name. If `None`, a default local backend is returned,
247 typically `gpu` if one is present, or `cpu` if not. If a string, the named
248 backend is returned or an exception raised.
249
250 Returns:
251 A LocalBackend object.
252 """
253 backends = _get_local_backends()
254 if name is not None:
255 try:
256 return backends[name]
257 except KeyError:
258 raise RuntimeError('Unknown backend {}'.format(name))
259
260 return list(backends.values())[-1]
261
262
263class OpMetadata(object):

Callers 7

from_pyvalMethod · 0.85
make_tupleMethod · 0.85
transfer_to_infeedFunction · 0.85
transfer_from_outfeedFunction · 0.85
CompileMethod · 0.85

Calls 3

_get_local_backendsFunction · 0.85
formatMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected