ak.tracing.interpreter.Interpreter#
Defined in awkward.tracing.interpreter on line 42.
- class ak.tracing.interpreter.Interpreter(self, trace_stack)#
This is a simple mini interpreter that replays the trace_stack in order. The trace_stack is a list of MainTrace objects, each of them contains a FuncCapture object that represents a computation and the input and output arrays of that computation. A trace_stack can be seen as a little program, which only takes container(s) of buffers as input and returns container(s) of buffers as output.
The benefit of this is that we can avoid all python overhead that comes with the computations if we’d run them on highlevel awkward-arrays. Instead, we can run the computation on the buffers directly, and skip a lot of layout traversals, type checks, etc. - every “metadata” computation that is run already in the typetracing step.
- ak.tracing.interpreter.Interpreter.lifetimes(self)#
This is a pre-run step that infers some information we need during the actual computation, i.e. until when do we need to keep intermediate buffers?
- ak.tracing.interpreter.Interpreter.run(self, env)#