Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 2b92f05

Browse files
nicolasvasilacheJules Pondard
authored andcommitted
Use proper int division operator
Without this, the following error occurs: `TypeError: 'float' object cannot be interpreted as an integer`
1 parent f953ade commit 2b92f05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/examples/min_distance.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ def argmin_1d(float(N) S, int32(D) MinIdx) -> (min_idx) {
103103

104104
T = tc.define(lang, tc.make_naive_options_factory())
105105
S = T.reduce_codes(luts_t, codes_t)
106-
V = T.min_2d(S.view((D, N / D)))
106+
V = T.min_2d(S.view((D, N // D)))
107107
v = T.min_1d(V)
108-
MinIdx = T.argmin_2d(S.view((D, N / D)), v)
108+
MinIdx = T.argmin_2d(S.view((D, N // D)), v)
109109
min_idx = T.argmin_1d(S, MinIdx)
110110
print("minval: {} minidx: {}".format(v, min_idx))
111111

@@ -159,8 +159,8 @@ def argmin_1d(float(K, N) S, int32(K, D) MinIdx2) -> (MinIdx) {
159159

160160
T = tc.define(lang, tc.make_naive_options_factory())
161161
S = T.reduce_codes(luts_t, codes_t)
162-
V2 = T.min_2d(S.view((K, D, N / D)))
162+
V2 = T.min_2d(S.view((K, D, N // D)))
163163
V = T.min_1d(V2)
164-
MinIdx2 = T.argmin_2d(S.view((K, D, N / D)), V)
164+
MinIdx2 = T.argmin_2d(S.view((K, D, N // D)), V)
165165
MinIdx = T.argmin_1d(S, MinIdx2)
166166
print("minval: {} minidx: {}".format(V, MinIdx))

0 commit comments

Comments
 (0)