MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SubstitutePlaceholders

Function SubstitutePlaceholders

tensorflow/core/framework/attr_value_util.cc:620–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620bool SubstitutePlaceholders(const SubstituteFunc& substitute,
621 AttrValue* value) {
622 switch (value->value_case()) {
623 case AttrValue::kList: {
624 for (NameAttrList& func : *value->mutable_list()->mutable_func()) {
625 for (auto& p : *func.mutable_attr()) {
626 if (!SubstitutePlaceholders(substitute, &p.second)) {
627 return false;
628 }
629 }
630 }
631 break;
632 }
633 case AttrValue::kFunc:
634 for (auto& p : *(value->mutable_func()->mutable_attr())) {
635 if (!SubstitutePlaceholders(substitute, &p.second)) {
636 return false;
637 }
638 }
639 break;
640 case AttrValue::kPlaceholder:
641 return substitute(value->placeholder(), value);
642 case AttrValue::VALUE_NOT_SET:
643 return false;
644 default:
645 break;
646 }
647 return true;
648}
649
650} // namespace tensorflow

Callers 2

TESTFunction · 0.85
InstantiateFunctionFunction · 0.85

Calls 1

placeholderMethod · 0.45

Tested by 1

TESTFunction · 0.68