tf.contrib.kfac.utils.extract_convolution_patches

tf.contrib.kfac.utils.extract_convolution_patches(
    inputs,
    filter_shape,
    padding,
    strides=None,
    dilation_rate=None,
    name=None,
    data_format=None
)

Defined in tensorflow/contrib/kfac/python/ops/utils.py.

Extracts inputs to each output coordinate in tf.nn.convolution.

This is a generalization of tf.extract_image_patches() to tf.nn.convolution(), where the number of spatial dimensions may be something other than 2.

Assumes, - First dimension of inputs is batch_size - Convolution filter is applied to all input channels.

Args:

  • inputs: Tensor of shape [batch_size, ..spatial_image_shape.., ..spatial_filter_shape.., in_channels]. Inputs to tf.nn.convolution().
  • filter_shape: List of ints. Shape of filter passed to tf.nn.convolution().
  • padding: string. Padding method. One of "VALID", "SAME".
  • strides: None or list of ints. Strides along spatial dimensions.
  • dilation_rate: None or list of ints. Dilation along spatial dimensions.
  • name: None or str. Name of Op.
  • data_format: None or str. Format of data.

Returns:

Tensor of shape [batch_size, ..spatial_image_shape.., ..spatial_filter_shape.., in_channels]

Raises:

  • ValueError: If data_format does not put channel last.
  • ValueError: If inputs and filter disagree on in_channels.