From c4d9acd4e07c6f1ee521b2998a1f28e67a118ba2 Mon Sep 17 00:00:00 2001 From: Kunal Mansukhani <24417742+kunal-mansukhani@users.noreply.github.com> Date: Thu, 19 Nov 2026 09:23:48 -0800 Subject: [PATCH] Fix example rounding and make example tests mirror Example 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 5_softmax / 40_batch_normalization: round shown outputs correctly (0.245, ±1.225). - 52_silu, 14_multi_agent_sim, 61_rope_embedding, 64_weight_dequantization: generate_example_test() now uses the Example 1 inputs from challenge.html. --- challenges/easy/52_silu/challenge.py | 4 ++-- .../hard/14_multi_agent_sim/challenge.py | 2 +- .../40_batch_normalization/challenge.html | 2 +- challenges/medium/5_softmax/challenge.html | 2 +- .../medium/61_rope_embedding/challenge.py | 16 ++++++++++----- .../64_weight_dequantization/challenge.py | 20 ++++++++++++------- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/challenges/easy/52_silu/challenge.py b/challenges/easy/52_silu/challenge.py index 491379cf..c6f929d3 100644 --- a/challenges/easy/52_silu/challenge.py +++ b/challenges/easy/52_silu/challenge.py @@ -29,8 +29,8 @@ def get_solve_signature(self) -> Dict[str, tuple]: def generate_example_test(self) -> Dict[str, Any]: dtype = torch.float32 - N = 4 - input = torch.tensor([1.0, 2.0, 3.0, 4.0], device=self.device, dtype=dtype) + N = 3 + input = torch.tensor([0.5, 1.0, -0.5], device=self.device, dtype=dtype) output = torch.empty(N, device=self.device, dtype=dtype) return { "input": input, diff --git a/challenges/hard/14_multi_agent_sim/challenge.py b/challenges/hard/14_multi_agent_sim/challenge.py index a730931c..f6d1e618 100644 --- a/challenges/hard/14_multi_agent_sim/challenge.py +++ b/challenges/hard/14_multi_agent_sim/challenge.py @@ -81,7 +81,7 @@ def generate_example_test(self) -> Dict[str, Any]: dtype = torch.float32 N = 2 agents = torch.tensor( - [0.0, 0.0, 1.0, 0.0, 5.0, 0.0, 0.0, 1.0], device=self.device, dtype=dtype + [0.0, 0.0, 1.0, 0.0, 3.0, 4.0, 0.0, -1.0], device=self.device, dtype=dtype ) agents_next = torch.empty(4 * N, device=self.device, dtype=dtype) return { diff --git a/challenges/medium/40_batch_normalization/challenge.html b/challenges/medium/40_batch_normalization/challenge.html index 26c8b27d..ee8e4ddb 100644 --- a/challenges/medium/40_batch_normalization/challenge.html +++ b/challenges/medium/40_batch_normalization/challenge.html @@ -27,7 +27,7 @@
Input: [1.0, 2.0, 3.0], N = 3 -Output: [0.090, 0.244, 0.665] (approximately) +Output: [0.090, 0.245, 0.665] (approximately)