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

Method only_reset_raw_storage

src/core/impl/tensor.cpp:305–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303
304template <class Trait>
305void TensorStorage<Trait>::only_reset_raw_storage(
306 CompNode node, size_t size, RawStorage data, size_t offset) {
307 mgb_assert(m_allow_realloc);
308 m_comp_node = node;
309 m_size = size;
310 m_capacity = size;
311 m_offset = offset;
312 m_data = std::move(data);
313 *m_ref_ptr = static_cast<void*>(m_data.get());
314}
315
316template <class Trait>
317template <class RTrait, typename>

Callers 13

scalar2storageFunction · 0.80
vec2storageFunction · 0.80
as_tensor_ndMethod · 0.80
pyseq2hvalFunction · 0.80
resetMethod · 0.80
parse_shapeMethod · 0.80
TESTFunction · 0.80
tensor.cppFile · 0.80
test_basic_input_no_copyFunction · 0.80
TESTFunction · 0.80

Calls 1

getMethod · 0.45

Tested by 4

TESTFunction · 0.64
test_basic_input_no_copyFunction · 0.64
TESTFunction · 0.64
test_subtensor_recordFunction · 0.64