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

Method scn_do_execute

src/opr/impl/basic_arith.cpp:285–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void Elemwise::scn_do_execute() {
286 auto&& inp = input();
287 megdnn::TensorNDArray dnn_inp;
288 mgb_assert(dnn_inp.capacity() >= inp.size(), "heap allocation in elemwise exec");
289 dnn_inp.resize(inp.size());
290 for (size_t i = 0; i < inp.size(); ++i) {
291 if (inp[i]->dev_tensor().empty()) {
292 mgb_assert(output(0)->dev_tensor().empty());
293 return;
294 }
295 dnn_inp[i] = (inp[i]->dev_tensor().as_megdnn());
296 }
297 mgb_assert(!output(0)->dev_tensor().empty());
298
299 megdnn_opr()->param() = param();
300 call_megdnn_opr_exec(
301 comp_node(), dnn_inp, output(0)->dev_tensor().as_megdnn(), megdnn_opr(),
302 this);
303}
304
305void Elemwise::init_output_static_infer_desc() {
306 Super::init_output_static_infer_desc();

Callers

nothing calls this directly

Calls 15

comp_nodeFunction · 0.85
capacityMethod · 0.80
resizeMethod · 0.80
as_megdnnMethod · 0.80
copy_from_fixlayoutMethod · 0.80
storageMethod · 0.80
check_shapesMethod · 0.80
has_actual_computingMethod · 0.80
update_ptrMethod · 0.80
paramFunction · 0.50
scn_do_executeFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected