�
�ݲj~2 � �� � d Z ddlZddlZddlmZmZ ddlmZ ddlZddl m
Z
e G d� d� � Ze G d� d � � Zd
e
ez de
deeef fd
�Zdd�Zedk( r e� yy)u� Load a gras-evolved net into pure PyTorch — no gras, no Rust needed.
gras exports every trained net as two artifacts in the run dir:
nets/<full-hash>.json — the topology (the "how to build it")
elite-<short-hash>.safetensors — the trained weights (or nets/<hash>.json
snapshots for non-elites, same format)
The safetensors naming convention has **two families**, and BOTH must be
loaded (see the note at the bottom for why):
node<N>.weight / node<N>.bias — one Linear per graph node
proj<N>_<port>_<src>.weight / .bias — one Linear per cross-dim bridge
(a wire whose source and target
node dims differ)
Requirements: `pip install safetensors torch` (numpy optional). Test:
python examples/python/load_gras_net.py results/<run_dir> <hash-prefix>
� N)� dataclass�field)�Path)� load_filec � � e Zd ZU eed<