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

Method reset

imperative/src/include/megbrain/imperative/value.h:468–477  ·  view source on GitHub ↗

* \brief reset underlying value to another value * * \param successor new value */

Source from the content-addressed store, hash-verified

466 * \param successor new value
467 */
468 inline void reset(ValueRef successor) {
469 static_assert(std::is_base_of_v<ObjectValue<T>, T>);
470 mgb_assert(m_storage);
471 mgb_assert(!m_storage->m_successor);
472 if (m_storage->m_watching) {
473 debug::notify_event("reset");
474 }
475 m_storage->clear();
476 m_storage->m_successor = ValueRef(successor.storage());
477 }
478
479 static inline const TypedValueRef nil;
480

Callers

nothing calls this directly

Calls 4

notify_eventFunction · 0.85
storageMethod · 0.80
ValueRefClass · 0.70
clearMethod · 0.45

Tested by

no test coverage detected