diff options
author | Malte Stær Nissen <nissen@di.ku.dk> | 2017-05-04 14:33:40 +0200 |
---|---|---|
committer | Malte Stær Nissen <nissen@di.ku.dk> | 2017-05-04 14:36:58 +0200 |
commit | ec35395e131a0d5e7c55cbd74dadbd46a49a645c (patch) | |
tree | af14b8a6a26018a8e80a5a75fa945c74b19fcd39 | |
parent | eeebdab16155d34ff8f5f42137da7df4d1c7eab0 (diff) | |
download | caffe-ec35395e131a0d5e7c55cbd74dadbd46a49a645c.tar.gz caffe-ec35395e131a0d5e7c55cbd74dadbd46a49a645c.tar.bz2 caffe-ec35395e131a0d5e7c55cbd74dadbd46a49a645c.zip |
Handling destruction of empty Net objects
-rw-r--r-- | matlab/+caffe/Net.m | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/matlab/+caffe/Net.m b/matlab/+caffe/Net.m index 349e060e..bb99ec89 100644 --- a/matlab/+caffe/Net.m +++ b/matlab/+caffe/Net.m @@ -69,7 +69,9 @@ classdef Net < handle self.blob_names = self.attributes.blob_names; end function delete (self) - caffe_('delete_net', self.hNet_self); + if ~isempty(self.hNet_self) + caffe_('delete_net', self.hNet_self); + end end function layer = layers(self, layer_name) CHECK(ischar(layer_name), 'layer_name must be a string'); |