未验证 提交 0c0817cf 编写于 作者: littletomatodonkey's avatar littletomatodonkey 提交者: GitHub

fix pad tuple (#35985)

* fix pad tuple

* fix format
上级 17adcf68
......@@ -1274,7 +1274,8 @@ def pad(x, pad, mode='constant', value=0, data_format="NCHW", name=None):
x_dim = len(x.shape)
if mode == "constant" and isinstance(pad, list) and len(pad) == x_dim * 2:
if mode == "constant" and isinstance(pad, (
list, tuple)) and len(pad) == x_dim * 2:
return layers.pad(x, pad, pad_value=value)
assert x_dim in [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册