Get the names of the devices that has nodes of the specified name. Args: node_name: (`str`) name of the node. Returns: (`str` or `list` of `str`) name of the device(s) on which the node of the given name is found. Returns a `str` if there is only one such device,
(self, node_name)
| 1295 | return False |
| 1296 | |
| 1297 | def node_device(self, node_name): |
| 1298 | """Get the names of the devices that has nodes of the specified name. |
| 1299 | |
| 1300 | Args: |
| 1301 | node_name: (`str`) name of the node. |
| 1302 | |
| 1303 | Returns: |
| 1304 | (`str` or `list` of `str`) name of the device(s) on which the node of the |
| 1305 | given name is found. Returns a `str` if there is only one such device, |
| 1306 | otherwise return a `list` of `str`. |
| 1307 | |
| 1308 | Raises: |
| 1309 | LookupError: If node inputs and control inputs have not been loaded |
| 1310 | from partition graphs yet. |
| 1311 | ValueError: If the node does not exist in partition graphs. |
| 1312 | """ |
| 1313 | if not self._debug_graphs: |
| 1314 | raise LookupError( |
| 1315 | "Node devices are not loaded from partition graphs yet.") |
| 1316 | |
| 1317 | if node_name not in self._node_devices: |
| 1318 | raise ValueError("Node '%s' does not exist in partition graphs." % |
| 1319 | node_name) |
| 1320 | |
| 1321 | output = list(self._node_devices[node_name]) |
| 1322 | return output[0] if len(output) == 1 else output |
| 1323 | |
| 1324 | def node_op_type(self, node_name, device_name=None): |
| 1325 | """Get the op type of given node. |
no outgoing calls