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

Method reset

src/core/impl/tensor.cpp:294–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292
293template <class Trait>
294void TensorStorage<Trait>::reset(CompNode node, size_t size, RawStorage data) {
295 mgb_assert(m_allow_realloc);
296 m_comp_node = node;
297 m_size = size;
298 m_capacity = size;
299 m_offset = 0;
300 m_data = std::move(data);
301 m_ref_ptr = std::make_shared<void*>(static_cast<void*>(m_data.get()));
302}
303
304template <class Trait>
305void TensorStorage<Trait>::only_reset_raw_storage(

Callers 15

read_into_tensorMethod · 0.45
makeMethod · 0.45
makeMethod · 0.45
applyMethod · 0.45
fill_tensor_memoryMethod · 0.45
run<level2_exec_check>Function · 0.45
TESTFunction · 0.45
test_free_memFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 1

getMethod · 0.45

Tested by 13

run<level2_exec_check>Function · 0.36
TESTFunction · 0.36
test_free_memFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
alloc_dynamicMethod · 0.36
alloc_dynamicMethod · 0.36
alloc_dynamicMethod · 0.36
TESTFunction · 0.36