def get_conv_gradinputs_shape_1axis(kernel_shape, top_shape, border_mode, subsample, dilation):
 if (None in [kernel_shape, top_shape, border_mode, subsample, dilation]):
  return None
 if (subsample != 1):
  return None
 dil_kernel_shape = (((kernel_shape - 1) * dilation) + 1)
 if (border_mode == 'half'):
  pad = (dil_kernel_shape // 2)
 elif (border_mode == 'full'):
  pad = (dil_kernel_shape - 1)
 elif (border_mode == 'valid'):
  pad = 0
 else:
  pad = border_mode
  if (pad < 0):
   raise ValueError('border_mode must be >= 0')
 if (pad == 0):
  image_shape = ((top_shape + dil_kernel_shape) - 1)
 else:
  image_shape = (((top_shape - (2 * pad)) + dil_kernel_shape) - 1)
 return image_shape

def get_conv_gradinputs_shape_1axis ( kernel_shape , top_shape , border_mode , subsample , dilation ) : if ( None in [ kernel_shape , top_shape , border_mode , subsample , dilation ] ) : return None if ( subsample != 1 ) : return None dil_kernel_shape = ( ( ( kernel_shape - 1 ) * dilation ) + 1 ) if ( border_mode == 'half' ) : pad = ( dil_kernel_shape // 2 ) elif ( border_mode == 'full' ) : pad = ( dil_kernel_shape - 1 ) elif ( border_mode == 'valid' ) : pad = 0 else : pad = border_mode if ( pad < 0 ) : raise ValueError ( 'border_mode must be >= 0' ) if ( pad == 0 ) : image_shape = ( ( top_shape + dil_kernel_shape ) - 1 ) else : image_shape = ( ( ( top_shape - ( 2 * pad ) ) + dil_kernel_shape ) - 1 ) return image_shape
this function tries to compute the image shape of convolution gradinputs .