mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 15:16:26 +01:00
cnn: Fix floating point exception ( rand()%0 )
This commit is contained in:
parent
dbd5362d7d
commit
2743fcda14
@ -106,8 +106,8 @@ void write_image_in_network_32(int** image, int height, int width, float** input
|
||||
max_col--;
|
||||
}
|
||||
|
||||
i_offset = rand()%(27-max_ligne+min_ligne);
|
||||
j_offset = rand()%(27-max_col+min_col);
|
||||
i_offset = 27-max_ligne+min_ligne == 0 ? 0 : rand()%(27-max_ligne+min_ligne);
|
||||
j_offset = 27 - max_col + min_col == 0 ? 0 : rand()%(27-max_col+min_col);
|
||||
}
|
||||
|
||||
int padding = (32 - height)/2;
|
||||
|
Loading…
Reference in New Issue
Block a user