From 7f5987ff22212b5c80caaddf118240bf8fb2c0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E7=BF=8A=E5=87=A1?= Date: Sat, 15 Aug 2026 16:25:45 +0800 Subject: [PATCH] fix: defer np.typing annotation evaluation The np.typing.ArrayLike annotation on update_seeds is evaluated when the BatchExampleIter class body executes at module import time. On numpy < 2.0, np.typing only resolves after an explicit 'import numpy.typing', which nothing on the training import path provides. Add 'from __future__ import annotations' so the annotation is deferred and the training entry points work on every numpy version, independent of import order. --- ffn/training/examples.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ffn/training/examples.py b/ffn/training/examples.py index 13e6c2a..a6eff48 100644 --- a/ffn/training/examples.py +++ b/ffn/training/examples.py @@ -14,6 +14,8 @@ # ============================================================================== """Utilities for building training examples for FFN training.""" +from __future__ import annotations + import collections from concurrent import futures import itertools