Skip to content

Commit 567d0d7

Browse files
committed
fix: fix integer overflow when loading large binary images
1 parent 530c0f4 commit 567d0d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/viqa/utils/loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def _load_binary(data_file_path, data_type, dim_size):
596596
file=f, dtype=data_type
597597
) # Read data file into numpy array according to data type
598598

599-
if img_arr_orig.size != np.prod(dim_size):
599+
if img_arr_orig.size != np.prod(np.array(dim_size).astype(np.int64)):
600600
raise ValueError(
601601
"Size of data file ("
602602
+ data_file_path

0 commit comments

Comments
 (0)