提交 60bf45cf 编写于 作者: L liuqi

Fix some bad code style.

上级 9ebc2ecb
...@@ -39,13 +39,16 @@ void CalcPaddingAndOutputSize(const index_t *input_shape, // NCHW ...@@ -39,13 +39,16 @@ void CalcPaddingAndOutputSize(const index_t *input_shape, // NCHW
index_t k_extent_width = (kernel_width - 1) * dilations[1] + 1; index_t k_extent_width = (kernel_width - 1) * dilations[1] + 1;
switch (padding) { switch (padding) {
case VALID:output_height = (input_shape[2] - k_extent_height) / strides[0] + 1; case VALID:
output_height = (input_shape[2] - k_extent_height) / strides[0] + 1;
output_width = (input_shape[3] - k_extent_width) / strides[1] + 1; output_width = (input_shape[3] - k_extent_width) / strides[1] + 1;
break; break;
case SAME:output_height = (input_shape[2] - 1) / strides[0] + 1; case SAME:
output_height = (input_shape[2] - 1) / strides[0] + 1;
output_width = (input_shape[3] - 1) / strides[1] + 1; output_width = (input_shape[3] - 1) / strides[1] + 1;
break; break;
case FULL:output_height = (input_shape[2] + k_extent_height - 2) / strides[0] + 1; case FULL:
output_height = (input_shape[2] + k_extent_height - 2) / strides[0] + 1;
output_width = (input_shape[3] + k_extent_width - 2) / strides[1] + 1; output_width = (input_shape[3] + k_extent_width - 2) / strides[1] + 1;
break; break;
default:MACE_CHECK(false, "Unsupported padding type: ", padding); default:MACE_CHECK(false, "Unsupported padding type: ", padding);
...@@ -87,13 +90,16 @@ void CalPaddingSize(const index_t *input_shape, // NCHW ...@@ -87,13 +90,16 @@ void CalPaddingSize(const index_t *input_shape, // NCHW
index_t k_extent_width = (filter_shape[3] - 1) * dilations[1] + 1; index_t k_extent_width = (filter_shape[3] - 1) * dilations[1] + 1;
switch (padding) { switch (padding) {
case VALID:output_height = (input_shape[2] - k_extent_height) / strides[0] + 1; case VALID:
output_height = (input_shape[2] - k_extent_height) / strides[0] + 1;
output_width = (input_shape[3] - k_extent_width) / strides[1] + 1; output_width = (input_shape[3] - k_extent_width) / strides[1] + 1;
break; break;
case SAME:output_height = (input_shape[2] - 1) / strides[0] + 1; case SAME:
output_height = (input_shape[2] - 1) / strides[0] + 1;
output_width = (input_shape[3] - 1) / strides[1] + 1; output_width = (input_shape[3] - 1) / strides[1] + 1;
break; break;
case FULL:output_height = (input_shape[2] + k_extent_height - 2) / strides[0] + 1; case FULL:
output_height = (input_shape[2] + k_extent_height - 2) / strides[0] + 1;
output_width = (input_shape[3] + k_extent_width - 2) / strides[1] + 1; output_width = (input_shape[3] + k_extent_width - 2) / strides[1] + 1;
break; break;
default:MACE_CHECK(false, "Unsupported padding type: ", padding); default:MACE_CHECK(false, "Unsupported padding type: ", padding);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册