Fix `pool3d` padding of Theano
@@ -2200,9 +2200,9 @@ def pool3d(x, pool_size, strides=(1, 1, 1), padding='valid',
w_pad = pool_size[0] - 2 if pool_size[0] % 2 == 1 else pool_size[0] - 1
h_pad = pool_size[1] - 2 if pool_size[1] % 2 == 1 else pool_size[1] - 1
d_pad = pool_size[2] - 2 if pool_size[2] % 2 == 1 else pool_size[2] - 1
- padding = (w_pad, h_pad, d_pad)
+ pad = (w_pad, h_pad, d_pad)
elif padding == 'valid':
- padding = (0, 0, 0)
+ pad = (0, 0, 0)
else:
raise ValueError('Invalid padding:', padding)
@@ -2212,12 +2212,12 @@ def pool3d(x, pool_size, strides=(1, 1, 1), padding='valid',
if pool_mode == 'max':
pool_out = pool.pool_3d(x, ws=pool_size, stride=strides,
ignore_border=True,
- pad=padding,
+ pad=pad,
mode='max')
elif pool_mode == 'avg':
pool_out = pool.pool_3d(x, ws=pool_size, stride=strides,
ignore_border=True,
- pad=padding,
+ pad=pad,
mode='average_exc_pad')
else:
raise ValueError('Invalid pooling mode:', pool_mode)
