transformer-xray / scripts /test_architectures.py

Commit History

(1) test_architectures.py: 17 archs covered with invariants (head detected, loop present, FLOPs > 0, min depth, source extraction). All pass. (2) FLOPs aggregation fixes: read tree dict 'args'+'repeat' fields (not 'config' which only flat nodes have); Linear+Head both compute 2·in·out; Loop multiplies children by repeat. (3) _eval handles getattr(config, 'X', default) — fixes Llama q_proj resolving num_attention_heads * head_dim. (4) HEAD_ATTR_NAMES adds cls, vocab_projector, embed_out for BERT/DeBERTa/DistilBert variants
a5da241
verified

AlexWortega commited on