Skip to content

Commit 2e473f2

Browse files
fix pad tuple (#36043)
* fix pad tuple * fix format
1 parent e262125 commit 2e473f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/paddle/nn/functional/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,8 @@ def pad(x, pad, mode='constant', value=0, data_format="NCHW", name=None):
12741274

12751275
x_dim = len(x.shape)
12761276

1277-
if mode == "constant" and isinstance(pad, list) and len(pad) == x_dim * 2:
1277+
if mode == "constant" and isinstance(pad, (
1278+
list, tuple)) and len(pad) == x_dim * 2:
12781279
return layers.pad(x, pad, pad_value=value)
12791280

12801281
assert x_dim in [

0 commit comments

Comments
 (0)