summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2015-12-02 18:31:26 -0800
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2016-02-25 13:32:54 -0800
commit0d9a78f5a083db859f01d45da91c5a0ca1389de8 (patch)
tree71013d4a1ba3f733574bef6c32c10b160f411f2d /src
parent51f79a837ddea002746d86d69e342a44f099654f (diff)
downloadcaffeonacl-0d9a78f5a083db859f01d45da91c5a0ca1389de8.tar.gz
caffeonacl-0d9a78f5a083db859f01d45da91c5a0ca1389de8.tar.bz2
caffeonacl-0d9a78f5a083db859f01d45da91c5a0ca1389de8.zip
collect Net inputs from Input layers
Restore the list of net inputs for compatibility with the pycaffe and matcaffe interfaces and downstream C++.
Diffstat (limited to 'src')
-rw-r--r--src/caffe/net.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/caffe/net.cpp b/src/caffe/net.cpp
index b7320e95..c1760ea1 100644
--- a/src/caffe/net.cpp
+++ b/src/caffe/net.cpp
@@ -103,6 +103,12 @@ void Net<Dtype>::Init(const NetParameter& in_param) {
int num_top = layer_param.top_size();
for (int top_id = 0; top_id < num_top; ++top_id) {
AppendTop(param, layer_id, top_id, &available_blobs, &blob_name_to_idx);
+ // Collect Input layer tops as Net inputs.
+ if (layer_param.type() == "Input") {
+ const int blob_id = blobs_.size() - 1;
+ net_input_blob_indices_.push_back(blob_id);
+ net_input_blobs_.push_back(blobs_[blob_id].get());
+ }
}
// If the layer specifies that AutoTopBlobs() -> true and the LayerParameter
// specified fewer than the required number (as specified by