| 390 | } |
| 391 | |
| 392 | string Scope::GetUniqueNameForOp(const string& default_name) const { |
| 393 | if (impl()->single_use_scope()) { |
| 394 | if (impl()->op_name_.empty() || *impl()->scope_used_) { |
| 395 | *impl()->status_ = |
| 396 | errors::InvalidArgument("Cannot get a unique name in this scope"); |
| 397 | return ""; |
| 398 | } |
| 399 | *impl()->scope_used_ = true; |
| 400 | return impl()->op_name_; |
| 401 | } |
| 402 | return impl()->op_name_.empty() ? impl()->GetNameForOp(default_name) |
| 403 | : impl()->GetNameForOp(impl()->op_name_); |
| 404 | } |
| 405 | |
| 406 | Scope Scope::NewSubScope(const string& child_scope_name) const { |
| 407 | if (child_scope_name.empty()) { |