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

Method drop

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

Source from the content-addressed store, hash-verified

232}
233
234void ChannelImpl::drop(Handle handle) {
235 MGB_LOCK_GUARD(m_spin);
236 assert_available();
237 auto& state = get_channel_state();
238 if (state.options.enable_drop) {
239 mgb_assert(
240 m_valid_handle.find(handle) != m_valid_handle.end(),
241 "invalid handle: %p", handle);
242 auto* info = reinterpret_cast<TensorInfo*>(handle);
243 if (Profiler::is_profiling()) {
244 m_worker.add_task(
245 {Profiler::next_id(), Drop{info},
246 get_channel_state().stack_manager.dump()});
247 } else {
248 m_worker.add_task({
249 Profiler::next_id(),
250 Drop{info},
251 });
252 }
253 }
254}
255
256void ChannelImpl::dispatch_default_cpu(
257 std::shared_ptr<OpDef> op, const SmallVector<TensorInfo*>& input_infos,

Callers 1

apply_transformationMethod · 0.45

Calls 5

is_profilingFunction · 0.85
findMethod · 0.45
endMethod · 0.45
add_taskMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected