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

Method del_impl

imperative/src/impl/interpreter/interpreter_impl.cpp:218–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void ChannelImpl::del_impl(Handle handle) {
219 mgb_assert(m_valid_handle.count(handle), "invalid handle: %p", handle);
220 auto* info = reinterpret_cast<TensorInfo*>(handle);
221 m_valid_handle.erase(handle);
222 if (Profiler::is_profiling()) {
223 m_worker.add_task(
224 {Profiler::next_id(), Del{info},
225 get_channel_state().stack_manager.dump()});
226 } else {
227 m_worker.add_task({
228 Profiler::next_id(),
229 Del{info},
230 });
231 }
232}
233
234void ChannelImpl::drop(Handle handle) {
235 MGB_LOCK_GUARD(m_spin);

Callers

nothing calls this directly

Calls 5

is_profilingFunction · 0.85
countMethod · 0.45
eraseMethod · 0.45
add_taskMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected