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

Method Erase

tensorflow/compiler/jit/graphcycles/ordered_set.h:48–59  ·  view source on GitHub ↗

Removes `value` from the set. Assumes `value` is already present in the set.

Source from the content-addressed store, hash-verified

46 // Removes `value` from the set. Assumes `value` is already present in the
47 // set.
48 void Erase(T value) {
49 auto it = value_to_index_.find(value);
50 DCHECK(it != value_to_index_.end());
51
52 // Since we don't want to move values around in `value_sequence_` we swap
53 // the value in the last position and with value to be deleted and then
54 // pop_back.
55 value_to_index_[value_sequence_.back()] = it->second;
56 std::swap(value_sequence_[it->second], value_sequence_.back());
57 value_sequence_.pop_back();
58 value_to_index_.erase(it);
59 }
60
61 void Reserve(size_t new_size) {
62 value_to_index_.reserve(new_size);

Callers 5

TESTFunction · 0.45
RemoveNodeMethod · 0.45
RemoveEdgeMethod · 0.45
InsertEdgeMethod · 0.45
ContractEdgeMethod · 0.45

Calls 5

pop_backMethod · 0.80
findMethod · 0.45
endMethod · 0.45
backMethod · 0.45
eraseMethod · 0.45

Tested by 1

TESTFunction · 0.36