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

Function apply_release

imperative/src/impl/dispatch.cpp:10–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace {
9
10ValueRefList apply_release(const Operator& op, Span<ValueRef> inputs) {
11 auto& context = Transformation::get_context();
12 ValueRefList result;
13 size_t& depth = context.next_transformation;
14 mgb_assert(depth < context.transformations.size());
15 auto& transformation = *context.transformations[depth++];
16 CleanupGuard _{[&] { --depth; }};
17 if (context.bt != nullptr && context.record_trans_bt) {
18 std::vector<std::string> types;
19 for (size_t i = 0; i < inputs.size(); i++) {
20 types.push_back(inputs[i].raw_type());
21 }
22 context.bt->trans_stack_info.push_back(TransformationCallInfo{
23 depth, op.raw_type(), transformation.name(),
24 TransformationCallInfo::get_op_attr(op), std::move(types)});
25 }
26 result = transformation.apply_transformation(op, inputs);
27 if (context.bt != nullptr && context.record_trans_bt) {
28 std::vector<std::string> types;
29 for (size_t i = 0; i < result.size(); i++) {
30 types.push_back(result[i].raw_type());
31 }
32 context.bt->trans_stack_info.push_back(
33 TransformationReturnInfo{depth, std::move(types)});
34 }
35 if (depth - 1 == context.record_bt_trans_id) {
36 context.bt = nullptr;
37 }
38 return result;
39}
40
41MGB_NOINLINE ValueRefList apply_debug(const Operator& op, Span<ValueRef> inputs) {
42 auto& context = Transformation::get_context();

Callers 1

applyFunction · 0.85

Calls 5

sizeMethod · 0.45
push_backMethod · 0.45
raw_typeMethod · 0.45
nameMethod · 0.45
apply_transformationMethod · 0.45

Tested by

no test coverage detected