Fix computation of receptive field size for 'channels_last'
@@ -458,7 +458,7 @@ def _compute_fans(shape, data_format='channels_last'):
fan_in = shape[1] * receptive_field_size
fan_out = shape[0] * receptive_field_size
elif data_format == 'channels_last':
- receptive_field_size = np.prod(shape[:2])
+ receptive_field_size = np.prod(shape[:-2])
fan_in = shape[-2] * receptive_field_size
fan_out = shape[-1] * receptive_field_size
else:
