{# The circuit pages' shared parts. #} {% macro unit_name(u) %}L{{ u.layer }}/{{ u.label }}{% if u.dictionary %} ({{ u.dictionary }}){% endif %}{% endmacro %} {% macro nav(root, model, here) -%} {%- endmacro %} {# The wiring between a group's units, laid out by layer (builder.circuits.Circuit). #} {% macro wiring_svg(c, root) -%}
{% for e in c.edges %} {% set x1, y1 = c.positions[e.source.href] %}{% set x2, y2 = c.positions[e.target.href] %} {% set both = e.methods | length == 2 %} {% set cls = "stroke-brand-500" if both else ("stroke-sky-500" if e.methods[0] == "activations" else "stroke-slate-400") %} {% if x1 == x2 %} {{ unit_name(e.source) }} → {{ unit_name(e.target) }} {% else %} {{ unit_name(e.source) }} → {{ unit_name(e.target) }} {% endif %} {% endfor %} {% for u in c.units %} {% set x, y = c.positions[u.href] %} L{{ u.layer }}/{{ u.label }} {{ unit_name(u) }}{{ " · verified" if u.verified }} {% endfor %}
{%- endmacro %}