mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
fix make_dropout_layer
If you want to resize dropout layer, you may want to realloc inputs*l->batch*sizeof(float).
This commit is contained in:
parent
d1622c9bba
commit
f61f3171d9
@ -27,6 +27,8 @@ dropout_layer make_dropout_layer(int batch, int inputs, float probability)
|
|||||||
|
|
||||||
void resize_dropout_layer(dropout_layer *l, int inputs)
|
void resize_dropout_layer(dropout_layer *l, int inputs)
|
||||||
{
|
{
|
||||||
|
l->inputs = inputs
|
||||||
|
l->outputs = inputs
|
||||||
l->rand = realloc(l->rand, inputs*l->batch*sizeof(float));
|
l->rand = realloc(l->rand, inputs*l->batch*sizeof(float));
|
||||||
#ifdef GPU
|
#ifdef GPU
|
||||||
cuda_free(l->rand_gpu);
|
cuda_free(l->rand_gpu);
|
||||||
|
Loading…
Reference in New Issue
Block a user