MCPcopy Create free account
hub / github.com/BVLC/caffe / compute_output_shape

Method compute_output_shape

src/caffe/layers/deconv_layer.cpp:8–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7template <typename Dtype>
8void DeconvolutionLayer<Dtype>::compute_output_shape() {
9 const int* kernel_shape_data = this->kernel_shape_.cpu_data();
10 const int* stride_data = this->stride_.cpu_data();
11 const int* pad_data = this->pad_.cpu_data();
12 const int* dilation_data = this->dilation_.cpu_data();
13 this->output_shape_.clear();
14 for (int i = 0; i < this->num_spatial_axes_; ++i) {
15 // i + 1 to skip channel axis
16 const int input_dim = this->input_shape(i + 1);
17 const int kernel_extent = dilation_data[i] * (kernel_shape_data[i] - 1) + 1;
18 const int output_dim = stride_data[i] * (input_dim - 1)
19 + kernel_extent - 2 * pad_data[i];
20 this->output_shape_.push_back(output_dim);
21 }
22}
23
24template <typename Dtype>
25void DeconvolutionLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,

Callers

nothing calls this directly

Calls 2

input_shapeMethod · 0.80
cpu_dataMethod · 0.45

Tested by

no test coverage detected