Skip to content

Commit f8fe296

Browse files
committed
TEST: Make test case work with both lpython, python
1 parent ca9af51 commit f8fe296

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

integration_tests/lnn/perceptron/perceptron_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ def normalize_input_vectors(input_vectors: list[list[f64]]):
4343

4444

4545
def get_inp_vec_with_bias(a: list[f64]) -> list[f64]:
46-
b: list[f64]
46+
b: list[f64] = []
4747
i: i32
4848
for i in range(len(a)):
4949
b.append(a[i])
5050
b.append(1.0)
5151
return b
5252

5353
def init_weights(size: i32) -> list[f64]:
54-
weights: list[f64]
54+
weights: list[f64] = []
5555
i: i32
5656
for i in range(size):
5757
weights.append(0.0)

integration_tests/lpdraw/draw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def Pixel(H: i32, W: i32, Screen: i32[H, W], x: i32, y: i32) -> None:
88
if x >= 0 and y >= 0 and x < W and y < H:
9-
Screen[H - 1 - y, x] = 255
9+
Screen[i32(int(H - 1 - y)), i32(int(x))] = 255
1010

1111
def Clear(H: i32, W: i32, Screen: i32[H, W]):
1212
i: i32

integration_tests/test_pkg_lnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def plot_graph(p: Perceptron, input_vectors: list[list[f64]], outputs: list[i32]
5050
Display(Height, Width, Screen)
5151

5252
def main0():
53-
p: Perceptron
53+
p: Perceptron = Perceptron(0, [0.0], 0.0, 0, 0.0, 0.0, 0)
5454
init_perceptron(p, 2, 0.05, 10000, 90.0)
5555
print_perceptron(p)
5656
print("=================================")

0 commit comments

Comments
 (0)