def _mean_image_subtraction(image, means):
 if (image.get_shape().ndims != 3):
  raise ValueError('Input must be of size [height, width, C>0]')
 num_channels = image.get_shape().as_list()[(-1)]
 if (len(means) != num_channels):
  raise ValueError('len(means) must match the number of channels')
 channels = tf.split(2, num_channels, image)
 for i in range(num_channels):
  channels[i] -= means[i]
 return tf.concat(2, channels)

def _mean_image_subtraction ( image , means ) : if ( image . get_shape ( ) . ndims != 3 ) : raise ValueError ( 'Input must be of size [height, width, C>0]' ) num_channels = image . get_shape ( ) . as_list ( ) [ ( - 1 ) ] if ( len ( means ) != num_channels ) : raise ValueError ( 'len(means) must match the number of channels' ) channels = tf . split ( 2 , num_channels , image ) for i in range ( num_channels ) : channels [ i ] -= means [ i ] return tf . concat ( 2 , channels )
subtracts the given means from each image channel .