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

Function GetSetAttrs

tensorflow/core/framework/function.cc:821–829  ·  view source on GitHub ↗

Returns the name -> attr mapping of fdef's attrs that have a value set. In Python, it's possible to access unset attrs, which returns a default value and adds an unset attr to the map.

Source from the content-addressed store, hash-verified

819// Python, it's possible to access unset attrs, which returns a default value
820// and adds an unset attr to the map.
821std::map<string, AttrValue> GetSetAttrs(const FunctionDef& fdef) {
822 std::map<string, AttrValue> set_attrs;
823 for (auto pair : fdef.attr()) {
824 if (pair.second.value_case() != AttrValue::VALUE_NOT_SET) {
825 set_attrs[pair.first] = pair.second;
826 }
827 }
828 return set_attrs;
829}
830
831} // end namespace
832

Callers 2

FunctionDefsEqualFunction · 0.85
FunctionDefHashFunction · 0.85

Calls 1

attrMethod · 0.80

Tested by

no test coverage detected