Returns the `Operation` with the given `name`. This method may be called concurrently from multiple threads. Args: name: The name of the `Operation` to return. Returns: The `Operation` with the given `name`. Raises: TypeError: If `name` is not a string. Ke
(self, name)
| 3725 | return list(self._nodes_by_id.values()) |
| 3726 | |
| 3727 | def get_operation_by_name(self, name): |
| 3728 | """Returns the `Operation` with the given `name`. |
| 3729 | |
| 3730 | This method may be called concurrently from multiple threads. |
| 3731 | |
| 3732 | Args: |
| 3733 | name: The name of the `Operation` to return. |
| 3734 | |
| 3735 | Returns: |
| 3736 | The `Operation` with the given `name`. |
| 3737 | |
| 3738 | Raises: |
| 3739 | TypeError: If `name` is not a string. |
| 3740 | KeyError: If `name` does not correspond to an operation in this graph. |
| 3741 | """ |
| 3742 | |
| 3743 | if not isinstance(name, six.string_types): |
| 3744 | raise TypeError("Operation names are strings (or similar), not %s." % |
| 3745 | type(name).__name__) |
| 3746 | return self.as_graph_element(name, allow_tensor=False, allow_operation=True) |
| 3747 | |
| 3748 | def _get_operation_by_name_unsafe(self, name): |
| 3749 | """Returns the `Operation` with the given `name`. |