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

Function AddDefaultAttrs

tensorflow/core/framework/function.cc:683–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683Status AddDefaultAttrs(const string& op,
684 const GetFunctionSignature& get_function,
685 AttrValueMap* attrs) {
686 const OpDef* op_def = nullptr;
687 TF_RETURN_IF_ERROR(get_function(op, &op_def));
688 AttrSlice attr_slice(attrs);
689 for (const auto& attr_def : op_def->attr()) {
690 if (attr_def.has_default_value() && !attr_slice.Find(attr_def.name())) {
691 if (!attrs->insert({attr_def.name(), attr_def.default_value()}).second) {
692 return errors::Internal("Somehow duplicated: ", attr_def.name());
693 }
694 }
695 }
696 return Status::OK();
697}
698
699} // end namespace
700

Callers 1

InstantiateFunctionFunction · 0.85

Calls 7

InternalFunction · 0.85
attrMethod · 0.80
has_default_valueMethod · 0.80
nameMethod · 0.65
FindMethod · 0.45
insertMethod · 0.45
default_valueMethod · 0.45

Tested by

no test coverage detected