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

Method __call__

tensorflow/python/framework/device.py:124–131  ·  view source on GitHub ↗
(self, node_def)

Source from the content-addressed store, hash-verified

122 self._spec = DeviceSpec.from_string(spec)
123
124 def __call__(self, node_def):
125 # In general a user may create a device function which takes into account
126 # arbitrary properties of an op. (For instance dynamically placing ops based
127 # on type.) So even though the standard DeviceSpec route only uses the
128 # device attribute, we take an entire node_def to maintain a consistent
129 # signature with general device functions.
130 current_device = DeviceSpec.from_string(node_def.device or "")
131 return self._spec.make_merged_spec(current_device)
132
133 def shortcut_string_merge(self, node_def):
134 """Merge a node def without materializing a full DeviceSpec object.

Callers 1

shortcut_string_mergeMethod · 0.95

Calls 2

from_stringMethod · 0.80
make_merged_specMethod · 0.80

Tested by

no test coverage detected