MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / ValueRefList apply_debug

Function ValueRefList apply_debug

imperative/src/impl/dispatch.cpp:41–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41MGB_NOINLINE ValueRefList apply_debug(const Operator& op, Span<ValueRef> inputs) {
42 auto& context = Transformation::get_context();
43 size_t& depth = context.next_transformation;
44 mgb_assert(depth < context.transformations.size());
45 static const char tabs[] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
46 const char* prefix = tabs + (sizeof(tabs) / sizeof(char)) - depth - 1;
47 mgb_log_debug(
48 "%s apply %s to %s", prefix, op.to_string().c_str(),
49 imperative::to_string(inputs).c_str());
50 ValueRefList result;
51 auto& transformation = *context.transformations[depth++];
52 CleanupGuard _{[&] { --depth; }};
53 result = transformation.apply_transformation(op, inputs);
54 mgb_log_debug(
55 "%s returns %s", prefix,
56 imperative::to_string(Span<ValueRef>(result)).c_str());
57 return result;
58}
59
60} // namespace
61

Callers

nothing calls this directly

Calls 4

to_stringFunction · 0.85
sizeMethod · 0.45
to_stringMethod · 0.45
apply_transformationMethod · 0.45

Tested by

no test coverage detected