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

fix pad tuple (#36043)

* fix pad tuple

* fix format
上级 e262125d
......@@ -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.
先完成此消息的编辑!
想要评论请 注册