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

Method reset

lite/src/tensor.cpp:224–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void Tensor::reset(void* prepared_data, size_t data_length_in_byte) {
225 LITE_ERROR_HANDLER_BEGIN
226 LITE_ASSERT(m_layout.ndim, "Tensor layout is empty, please reset with layout");
227 LITE_ASSERT(
228 data_length_in_byte >= get_tensor_total_size_in_byte(),
229 "the memory reset to the tensor is too small.");
230 m_tensor_impl->reset(prepared_data);
231 LITE_ERROR_HANDLER_END
232}
233
234void Tensor::reset(void* prepared_data, const Layout& layout) {
235 LITE_ERROR_HANDLER_BEGIN

Callers 15

device_inputFunction · 0.45
device_input_outputFunction · 0.45
pinned_host_inputFunction · 0.45
load_from_path_run_cudaFunction · 0.45
reset_inputFunction · 0.45
reset_input_outputFunction · 0.45
register_cryption_methodFunction · 0.45
update_cryption_keyFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
test_multi_threadFunction · 0.45

Calls

no outgoing calls

Tested by 8

TESTFunction · 0.36
TESTFunction · 0.36
test_multi_threadFunction · 0.36
test_output_no_copyFunction · 0.36
test_input_no_copyFunction · 0.36
test_io_no_copy_axFunction · 0.36
TESTFunction · 0.36
mgelite_larFunction · 0.36