mirror of https://github.com/pjreddie/darknet.git
Merge f89b2670a6
into f6afaabcdf
This commit is contained in:
commit
6345ddea98
|
@ -481,6 +481,7 @@ typedef struct network{
|
|||
float *truth;
|
||||
float *delta;
|
||||
float *workspace;
|
||||
size_t workspace_size;
|
||||
int train;
|
||||
int index;
|
||||
float *cost;
|
||||
|
|
|
@ -726,6 +726,17 @@ void free_network(network *net)
|
|||
if(net->input_gpu) cuda_free(net->input_gpu);
|
||||
if(net->truth_gpu) cuda_free(net->truth_gpu);
|
||||
#endif
|
||||
if(net->workspace_size){
|
||||
#ifdef GPU
|
||||
if(net->gpu_index >= 0){
|
||||
cuda_free(net->workspace);
|
||||
}else {
|
||||
free(net->workspace);
|
||||
}
|
||||
#else
|
||||
{free(net->workspace);}
|
||||
#endif
|
||||
}
|
||||
free(net);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue