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

Method GetIndex

tensorflow/core/profiler/internal/tfprof_code.cc:79–87  ·  view source on GitHub ↗

Returns the index of a string. If not found, inserts the string and return the inserted index.

Source from the content-addressed store, hash-verified

77 // Returns the index of a string. If not found, inserts the string and
78 // return the inserted index.
79 uint64 GetIndex(const string& str) {
80 auto idx = string_id_.find(str);
81 if (idx != string_id_.end()) {
82 return idx->second;
83 }
84 all_strings_.push_back(str);
85 return string_id_.insert(std::pair<string, int64>(str, string_id_.size()))
86 .first->second;
87 }
88
89 const std::vector<string>& strings() const { return all_strings_; }
90

Callers 5

GetIndexMethod · 0.45
GetIndexMethod · 0.45
AddMethod · 0.45
AddLocationMethod · 0.45
BuildMethod · 0.45

Calls 5

findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected