Returns the node name and position in a single call.
| 140 | |
| 141 | // Returns the node name and position in a single call. |
| 142 | inline StringPiece ParseNodeNameAsStringPiece(absl::string_view name, |
| 143 | int* position) { |
| 144 | const bool is_control = absl::StartsWith(name, "^"); |
| 145 | TensorId id = ParseTensorName(name); |
| 146 | if (position) { |
| 147 | *position = is_control ? -1 : id.second; |
| 148 | } |
| 149 | if (is_control && id.second >= 0) { |
| 150 | id.first.remove_prefix(1); |
| 151 | } |
| 152 | return id.first; |
| 153 | } |
| 154 | |
| 155 | // Returns the node name and position in a single call. |
| 156 | inline string ParseNodeName(const string& name, int* position) { |
no test coverage detected