Skip to content

Commit eef5ab1

Browse files
author
Han Wang
committed
test: align test doubles with the promoted capability contracts
DummyModel (jax2tf serialization test) gains get_var_name -> None; the _DescriptorWithStats stub gains the stat-flag class defaults that merge_env_stat now reads directly.
1 parent 910a1e0 commit eef5ab1

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

source/jax2tf_tests/test_serialization.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ def has_default_chg_spin(self) -> bool:
122122
def get_default_chg_spin(self) -> None:
123123
return None
124124

125+
def get_var_name(self) -> None:
126+
# non-property model, matching the make_base_model default
127+
return None
128+
125129
class DummyChargeSpinModel(DummyModel):
126130
dim_chg_spin = 2
127131

source/tests/jax/test_training.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,11 @@ def __call__(self) -> tuple[np.ndarray, np.ndarray]:
496496

497497

498498
class _DescriptorWithStats:
499+
# stat-behavior flags merge_env_stat reads directly on any
500+
# Descriptor/DescriptorBlock (class defaults on the real bases)
501+
set_davg_zero = False
502+
set_stddev_constant = False
503+
499504
def __init__(self, stats: dict[str, StatItem]) -> None:
500505
self.stats = stats
501506
self.davg = np.asarray([0.0], dtype=np.float64)

0 commit comments

Comments
 (0)