| 477 | } |
| 478 | |
| 479 | CompositeOpScopes Scope::GetCompositeOpScopes( |
| 480 | const string& composite_op_name) const { |
| 481 | if (impl()->op_name_.empty() && composite_op_name.empty()) { |
| 482 | UpdateStatus(errors::InvalidArgument( |
| 483 | "Cannot create composite op scopes with empty name")); |
| 484 | return {*this, *this}; |
| 485 | } |
| 486 | if (!impl()->single_use_scope()) { |
| 487 | Scope child = NewSubScope(impl()->op_name_.empty() ? composite_op_name |
| 488 | : impl()->op_name_); |
| 489 | const string child_op_sep = impl()->name_.empty() ? "" : kSuffixSeparator; |
| 490 | const string child_name = |
| 491 | strings::StrCat(impl()->name_, child_op_sep, child.impl()->name_); |
| 492 | return {child, |
| 493 | Scope(new Impl(child, Impl::Tags::SingleUseScope(), child_name))}; |
| 494 | } else { |
| 495 | return {Scope(new Impl(*this, Impl::Tags::ScopeName(), impl()->op_name_, |
| 496 | true /* copy_names */)), |
| 497 | *this}; |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | Status Scope::DoShapeInference(Node* node) const { |
| 502 | if (impl_->disable_shape_inference_) return Status::OK(); |