(self, node_def)
| 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. |
no test coverage detected