Skip to content

Commit 48ba837

Browse files
committed
add tests
1 parent 40c6b83 commit 48ba837

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
[
22
{
3-
"test": "print(your_function(...))",
4-
"expected_output": "..."
3+
"test": "import numpy as np\ngrad_list = [np.array([1.0, 2.0]), np.array([3.0, 4.0]), np.array([5.0, 6.0])]\nprint(accumulate_gradients(grad_list))",
4+
"expected_output": "[ 9. 12.]"
5+
},
6+
{
7+
"test": "import numpy as np\ngrad_list = [np.array([0.0, 0.0]), np.array([0.0, 0.0])]\nprint(accumulate_gradients(grad_list))",
8+
"expected_output": "[0. 0.]"
9+
},
10+
{
11+
"test": "import numpy as np\ngrad_list = [np.array([1.5, -2.5]), np.array([-1.5, 2.5])]\nprint(accumulate_gradients(grad_list))",
12+
"expected_output": "[0. 0.]"
13+
},
14+
{
15+
"test": "import numpy as np\ngrad_list = [np.array([10.0]), np.array([20.0]), np.array([30.0])]\nprint(accumulate_gradients(grad_list))",
16+
"expected_output": "[60.]"
17+
},
18+
{
19+
"test": "import numpy as np\ngrad_list = [np.array([1.0, 2.0, 3.0]), np.array([4.0, 5.0, 6.0])]\nprint(accumulate_gradients(grad_list))",
20+
"expected_output": "[5. 7. 9.]"
521
}
622
]

0 commit comments

Comments
 (0)