MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / set

Method set

imperative/python/src/graph_rt.h:90–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89 template <typename T>
90 void set(T&& value) {
91 MGB_LOCK_GUARD(m_lock);
92 mgb_assert(m_read_ahead >= 0);
93 mgb_assert(m_read_ahead <= 1);
94 if (m_drop_next) {
95 m_drop_next = false;
96 } else {
97 m_promise.set_value(std::forward<T>(value));
98 }
99 if (m_read_ahead == 1) {
100 m_promise = {};
101 }
102 --m_read_ahead;
103 }
104
105 void reset() {
106 MGB_LOCK_GUARD(m_lock);

Callers 5

def_rendezvousFunction · 0.45
init_graph_rtFunction · 0.45
putMethod · 0.45
apply_on_var_nodeFunction · 0.45

Calls 1

set_valueMethod · 0.45

Tested by 1