@@ -154,17 +154,17 @@ def evaluate(inshp, kshp, strides=(1, 1), nkern=1, mode="valid", ws=True):
154
154
155
155
# FOR EACH OUTPUT PIXEL...
156
156
# loop over output image height
157
- for oy in np .arange (lbound [0 ], ubound [0 ], dy ):
157
+ for oy in np .arange (lbound [0 ], ubound [0 ], dy , dtype = int ):
158
158
# loop over output image width
159
- for ox in np .arange (lbound [1 ], ubound [1 ], dx ):
159
+ for ox in np .arange (lbound [1 ], ubound [1 ], dx , dtype = int ):
160
160
161
161
# kern[l] is filter value to apply at (oj,oi)
162
162
# for (iy,ix)
163
163
l = 0 # noqa: E741
164
164
165
165
# ... ITERATE OVER INPUT UNITS IN RECEPTIVE FIELD
166
- for ky in oy + np .arange (kshp [0 ]):
167
- for kx in ox + np .arange (kshp [1 ]):
166
+ for ky in oy + np .arange (kshp [0 ], dtype = int ):
167
+ for kx in ox + np .arange (kshp [1 ], dtype = int ):
168
168
169
169
# verify if we are still within image
170
170
# boundaries. Equivalent to
@@ -176,13 +176,13 @@ def evaluate(inshp, kshp, strides=(1, 1), nkern=1, mode="valid", ws=True):
176
176
# convert to "valid" input space
177
177
# coords used to determine column
178
178
# index to write to in sparse mat
179
- iy , ix = np .array ((ky , kx )) - topleft
179
+ iy , ix = np .array ((ky , kx ), dtype = int ) - topleft
180
180
# determine raster-index of input pixel...
181
181
182
182
# taking into account multiple
183
183
# input features
184
184
col = (
185
- iy * inshp [2 ] + ix + fmapi * np .prod (inshp [1 :])
185
+ iy * inshp [2 ] + ix + fmapi * np .prod (inshp [1 :], dtype = int )
186
186
)
187
187
188
188
# convert oy,ox values to output
@@ -192,7 +192,7 @@ def evaluate(inshp, kshp, strides=(1, 1), nkern=1, mode="valid", ws=True):
192
192
else :
193
193
(y , x ) = (oy , ox ) - topleft
194
194
# taking into account step size
195
- (y , x ) = np .array ([y , x ]) / (dy , dx )
195
+ (y , x ) = np .array ([y , x ], dtype = int ) / (dy , dx )
196
196
197
197
# convert to row index of sparse matrix
198
198
if ws :
@@ -212,7 +212,7 @@ def evaluate(inshp, kshp, strides=(1, 1), nkern=1, mode="valid", ws=True):
212
212
# onto the sparse columns (idea of
213
213
# kernel map)
214
214
# n*... only for sparse
215
- spmat [row + n * outsize , col ] = tapi + 1
215
+ spmat [int ( row + n * outsize ), int ( col ) ] = tapi + 1
216
216
217
217
# total number of active taps
218
218
# (used for kmap)
0 commit comments