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

Function is_mge_frame

scripts/gdb/commands.py:73–89  ·  view source on GitHub ↗
(frame)

Source from the content-addressed store, hash-verified

71
72
73def is_mge_frame(frame):
74 function = frame.function()
75 if not (function and function.name):
76 return False
77 matcher = mge_apply_transform_pattern.match(function.name)
78 if matcher:
79 typename = matcher.group(1)
80 return is_subclass_of(
81 gdb.lookup_type(typename), gdb.lookup_type("mgb::imperative::Transform")
82 )
83 matcher = mge_op_fallback_pattern.match(function.name)
84 if matcher:
85 typename = matcher.group(1)
86 return is_subclass_of(
87 gdb.lookup_type(typename), gdb.lookup_type("mgb::imperative::Operator")
88 )
89 return False
90
91
92def count_frame_level(frame):

Callers 3

invokeMethod · 0.85
invokeMethod · 0.85
invokeMethod · 0.85

Calls 3

is_subclass_ofFunction · 0.85
functionMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected