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

Function _MaybeDevice

tensorflow/python/framework/importer.py:77–83  ·  view source on GitHub ↗

Applies the given device only if device is not None or empty.

(device)

Source from the content-addressed store, hash-verified

75
76@contextlib.contextmanager
77def _MaybeDevice(device):
78 """Applies the given device only if device is not None or empty."""
79 if device:
80 with ops.device(device):
81 yield
82 else:
83 yield
84
85
86def _ProcessGraphDefParam(graph_def, op_dict):

Callers 1

_ProcessNewOpsFunction · 0.85

Calls 1

deviceMethod · 0.45

Tested by

no test coverage detected