diff --git a/src/operator/nn/deconvolution-inl.h b/src/operator/nn/deconvolution-inl.h index 5f3137f0dcb8..e82a073ea08d 100644 --- a/src/operator/nn/deconvolution-inl.h +++ b/src/operator/nn/deconvolution-inl.h @@ -143,9 +143,9 @@ struct DeconvolutionParam : public dmlc::Parameter { } } } else { - for (size_t i = 0; i < ndim; i++) { - o_pad[i] = pad[i]; - o_adj[i] = adj[i]; + for (int i = 0; i < (int) ndim; i++) { + o_pad[i] = i < pad.ndim() ? pad[i] : 0; + o_adj[i] = i < adj.ndim() ? adj[i] : 0; } } }