| 6 | |
| 7 | template <typename Dtype> |
| 8 | void 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 | |
| 24 | template <typename Dtype> |
| 25 | void DeconvolutionLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, |
nothing calls this directly
no test coverage detected