Contents

class

SushiAI::Eager::ScopeTrace

Splits the nodes traced into one graph into segments, by the scope open at each.

Declared in
include/SushiAI/eager/scope_trace.hpp

See also

include/SushiAI/eager/README.md

Public member functions

explicit ScopeTrace(const Graph::Graph &graph) noexcept

Starts a trace over graph with no scope open.

Parameters

graph

The graph being traced; must outlive this object.

void open(std::string_view name)

Opens a scope nested in the current one.

Parameters

name

Scope name; not empty and without '/' or '#'.

void close()

Closes the innermost open scope.

Precondition

At least one scope is open.

std::vector< Segment > seal()

Ends the trace and returns its segments in node order.

Precondition

Every opened scope has been closed.

std::size_t depth() const noexcept

Returns how many scopes are open.