def _reduced_kernel_size_for_small_input(input_tensor, kernel_size):
 shape = input_tensor.get_shape().as_list()
 if ((shape[1] is None) or (shape[2] is None)):
  kernel_size_out = kernel_size
 else:
  kernel_size_out = [min(shape[1], kernel_size[0]), min(shape[2], kernel_size[1])]
 return kernel_size_out

def _reduced_kernel_size_for_small_input ( input_tensor , kernel_size ) : shape = input_tensor . get_shape ( ) . as_list ( ) if ( ( shape [ 1 ] is None ) or ( shape [ 2 ] is None ) ) : kernel_size_out = kernel_size else : kernel_size_out = [ min ( shape [ 1 ] , kernel_size [ 0 ] ) , min ( shape [ 2 ] , kernel_size [ 1 ] ) ] return kernel_size_out
define kernel size which is automatically reduced for small input .