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

Function InsertOrUpdate

tensorflow/core/lib/gtl/map_util.h:102–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100// value in the map is replaced with the value from the given pair.
101template <class Collection>
102bool InsertOrUpdate(Collection* const collection,
103 const typename Collection::value_type& vt) {
104 std::pair<typename Collection::iterator, bool> ret = collection->insert(vt);
105 if (!ret.second) {
106 // update
107 ret.first->second = vt.second;
108 return false;
109 }
110 return true;
111}
112
113// Same as above, except that the key and value are passed separately.
114template <class Collection>

Callers 6

AddOrUpdateRegularFaninFunction · 0.85
AddOrUpdateAttributeFunction · 0.85
AddFunctionDefMethod · 0.85
DoInsertMethod · 0.85
DoInsertMethod · 0.85

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected