From 61de8af873e9409ded511cc95a1abdb84968a6c0 Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Fri, 8 Jul 2022 15:36:03 +0800 Subject: [PATCH] fix tuple input for _conv_nd (#44108) --- python/paddle/nn/functional/conv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/paddle/nn/functional/conv.py b/python/paddle/nn/functional/conv.py index d8dc68376d1..3e73cab8f2c 100644 --- a/python/paddle/nn/functional/conv.py +++ b/python/paddle/nn/functional/conv.py @@ -130,6 +130,10 @@ def _conv_nd(x, if bias is not None: channel_dim = channel_dim + len( x.shape) if channel_dim < 0 else channel_dim + if isinstance(x, tuple): + x = x[0] + if isinstance(bias, tuple): + bias = bias[0] if len(bias.shape) < len(x.shape): tmp_bias = _C_ops.final_state_reshape( bias, bias.shape + -- GitLab