From 87de5edec8208f8726700c4301081cae9559a7fc Mon Sep 17 00:00:00 2001 From: Jonathan L Long Date: Wed, 10 Sep 2014 14:51:58 -0700 Subject: [PATCH] enable reshaping in the forward pass Note that calling Reshape when no reshape is necessary should be effectively a no-op, so this is not a performance regression. --- src/caffe/net.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/caffe/net.cpp b/src/caffe/net.cpp index a3e7122..a8db493 100644 --- a/src/caffe/net.cpp +++ b/src/caffe/net.cpp @@ -504,6 +504,7 @@ Dtype Net::ForwardFromTo(int start, int end) { Dtype loss = 0; for (int i = start; i <= end; ++i) { // LOG(ERROR) << "Forwarding " << layer_names_[i]; + layers_[i]->Reshape(bottom_vecs_[i], &top_vecs_[i]); Dtype layer_loss = layers_[i]->Forward(bottom_vecs_[i], &top_vecs_[i]); loss += layer_loss; if (debug_info_) { ForwardDebugInfo(i); } -- 2.7.4