mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 23:26:25 +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--;
|
max_col--;
|
||||||
}
|
}
|
||||||
|
|
||||||
i_offset = rand()%(27-max_ligne+min_ligne);
|
i_offset = 27-max_ligne+min_ligne == 0 ? 0 : rand()%(27-max_ligne+min_ligne);
|
||||||
j_offset = rand()%(27-max_col+min_col);
|
j_offset = 27 - max_col + min_col == 0 ? 0 : rand()%(27-max_col+min_col);
|
||||||
}
|
}
|
||||||
|
|
||||||
int padding = (32 - height)/2;
|
int padding = (32 - height)/2;
|
||||||
|
Loading…
Reference in New Issue
Block a user