未验证 提交 cc9d332e 编写于 作者: J Jason 提交者: GitHub

Merge pull request #343 from Channingss/Conv

fix bug for calculating auto_pad
...@@ -897,11 +897,11 @@ class OpSet9(): ...@@ -897,11 +897,11 @@ class OpSet9():
if auto_pad == "SAME_UPPER" or auto_pad == "SAME_LOWER": if auto_pad == "SAME_UPPER" or auto_pad == "SAME_LOWER":
input_shape = val_x.out_shapes[0] input_shape = val_x.out_shapes[0]
pad_h = get_same_padding(input_shape[2], kernel_shape[0], pad_h = _get_same_padding(input_shape[2], kernel_shape[0],
strides[0]) strides[0])
pad_w = get_same_padding(input_shape[3], kernel_shape[1], pad_w = _get_same_padding(input_shape[3], kernel_shape[1],
strides[1]) strides[1])
attr = {"paddings": pad_h + pad_w, "pad_value": 0.0} paddings = pad_h + pad_w
attr = { attr = {
"pool_size": kernel_shape, "pool_size": kernel_shape,
...@@ -1232,11 +1232,11 @@ class OpSet9(): ...@@ -1232,11 +1232,11 @@ class OpSet9():
if auto_pad == "SAME_UPPER" or auto_pad == "SAME_LOWER": if auto_pad == "SAME_UPPER" or auto_pad == "SAME_LOWER":
input_shape = val_x.out_shapes[0] input_shape = val_x.out_shapes[0]
pad_h = get_same_padding(input_shape[2], kernel_shape[0], pad_h = _get_same_padding(input_shape[2], kernel_shape[0],
strides[0]) strides[0])
pad_w = get_same_padding(input_shape[3], kernel_shape[1], pad_w = _get_same_padding(input_shape[3], kernel_shape[1],
strides[1]) strides[1])
attr = {"paddings": pad_h + pad_w, "pad_value": 0.0} paddings = pad_h + pad_w
attr = { attr = {
"pool_size": kernel_shape, "pool_size": kernel_shape,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册