diff --git a/python/paddle/nn/functional/common.py b/python/paddle/nn/functional/common.py index fcfbea438d7cca745405b2bda49c21e565123933..fdd370d7f81e72462500cf3b47beed8062a14c90 100644 --- a/python/paddle/nn/functional/common.py +++ b/python/paddle/nn/functional/common.py @@ -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 [