From 3ecfbcba57088af9e61040d3a0c7dd09376561c6 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Sun, 31 May 2026 00:02:29 +0000 Subject: [PATCH] Fix T scope in post_block --- single_shot_inference.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/single_shot_inference.py b/single_shot_inference.py index a2bf65ab..6ec85f2c 100644 --- a/single_shot_inference.py +++ b/single_shot_inference.py @@ -136,7 +136,8 @@ class mHCBlock: post_term = post_mix.unsqueeze(-1) * F_out.unsqueeze(1).float() residual_next = mixed_residual + post_term # Emergency: per-residual RMSNorm (routed MoE missing) - rn_f = residual_next.reshape(T, self.n_hc, -1) + _T = residual_next.shape[0] + rn_f = residual_next.reshape(_T, self.n_hc, -1) rms = rn_f.pow(2).mean(-1, keepdim=True).add(1e-6).rsqrt() return (rn_f * rms).bfloat16() # RoPE