The transpose of `convolution`. This operation is sometimes called "deconvolution" after [Deconvolutional Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf), but is actually the transpose (gradient) of `convolution` rather than an actual deconvolution. Args: input: An
(input, # pylint: disable=redefined-builtin
filters,
output_shape,
strides,
padding="SAME",
data_format=None,
dilations=None,
name=None)
| 2648 | |
| 2649 | @tf_export("nn.conv_transpose") |
| 2650 | def conv_transpose(input, # pylint: disable=redefined-builtin |
| 2651 | filters, |
| 2652 | output_shape, |
| 2653 | strides, |
| 2654 | padding="SAME", |
| 2655 | data_format=None, |
| 2656 | dilations=None, |
| 2657 | name=None): |
| 2658 | """The transpose of `convolution`. |
| 2659 | |
| 2660 | This operation is sometimes called "deconvolution" after [Deconvolutional |
| 2661 | Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf), but is |
| 2662 | actually the transpose (gradient) of `convolution` rather than an actual |
| 2663 | deconvolution. |
| 2664 | |
| 2665 | Args: |
| 2666 | input: An N+2 dimensional `Tensor` of shape |
| 2667 | `[batch_size] + input_spatial_shape + [in_channels]` if data_format does |
| 2668 | not start with "NC" (default), or |
| 2669 | `[batch_size, in_channels] + input_spatial_shape` if data_format starts |
| 2670 | with "NC". It must be one of the following types: |
| 2671 | `half`, `bfloat16`, `float32`, `float64`. |
| 2672 | filters: An N+2 dimensional `Tensor` with the same type as `input` and |
| 2673 | shape `spatial_filter_shape + [in_channels, out_channels]`. |
| 2674 | output_shape: A 1-D `Tensor` representing the output shape of the |
| 2675 | deconvolution op. |
| 2676 | strides: An int or list of `ints` that has length `1`, `N` or `N+2`. The |
| 2677 | stride of the sliding window for each dimension of `input`. If a single |
| 2678 | value is given it is replicated in the spatial dimensions. By default |
| 2679 | the `N` and `C` dimensions are set to 0. The dimension order is determined |
| 2680 | by the value of `data_format`, see below for details. |
| 2681 | padding: A string, either `'VALID'` or `'SAME'`. The padding algorithm. See |
| 2682 | the "returns" section of `tf.nn.convolution` for details. |
| 2683 | data_format: A string or None. Specifies whether the channel dimension of |
| 2684 | the `input` and output is the last dimension (default, or if `data_format` |
| 2685 | does not start with "NC"), or the second dimension (if `data_format` |
| 2686 | starts with "NC"). For N=1, the valid values are "NWC" (default) and |
| 2687 | "NCW". For N=2, the valid values are "NHWC" (default) and "NCHW". |
| 2688 | For N=3, the valid values are "NDHWC" (default) and "NCDHW". |
| 2689 | dilations: An int or list of `ints` that has length `1`, `N` or `N+2`, |
| 2690 | defaults to 1. The dilation factor for each dimension of`input`. If a |
| 2691 | single value is given it is replicated in the spatial dimensions. By |
| 2692 | default the `N` and `C` dimensions are set to 1. If set to k > 1, there |
| 2693 | will be k-1 skipped cells between each filter element on that dimension. |
| 2694 | The dimension order is determined by the value of `data_format`, see above |
| 2695 | for details. |
| 2696 | name: A name for the operation (optional). If not specified "conv_transpose" |
| 2697 | is used. |
| 2698 | |
| 2699 | Returns: |
| 2700 | A `Tensor` with the same type as `value`. |
| 2701 | """ |
| 2702 | with ops.name_scope(name, "conv_transpose", |
| 2703 | [input, filter, output_shape]) as name: |
| 2704 | if tensor_util.is_tensor(output_shape): |
| 2705 | n = output_shape.shape[0] - 2 |
| 2706 | elif isinstance(output_shape, collections.Sized): |
| 2707 | n = len(output_shape) - 2 |
nothing calls this directly
no test coverage detected