Either return trace using test operator or capture it via Python API
()
| 82 | |
| 83 | |
| 84 | def origin_trace(): |
| 85 | """Either return trace using test operator or capture it via Python API""" |
| 86 | if op_mode == "dali.fn": |
| 87 | return fn.origin_trace_dump() |
| 88 | if op_mode == "dali.ops": |
| 89 | return ops.OriginTraceDump()() # Yup, super obvious __init__ + __call__ |
| 90 | # elif op_mode == "python": |
| 91 | # Skip last frame as it differs from calling the fn.origin_trace_dump above. |
| 92 | extracted_stacks.append(traceback.extract_stack()[base_frame:-1]) |
| 93 | return None |
| 94 | |
| 95 | |
| 96 | def origin_trace_glob(op_mode): |
no test coverage detected