The transpose of `conv1d`. This operation is sometimes called "deconvolution" after [Deconvolutional Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf), but is really the transpose (gradient) of `conv1d` rather than an actual deconvolution. Args: input: A
(
input, # pylint: disable=redefined-builtin
filters,
output_shape,
strides,
padding="SAME",
data_format="NWC",
dilations=None,
name=None)
| 1791 | |
| 1792 | @tf_export("nn.conv1d_transpose") |
| 1793 | def conv1d_transpose( |
| 1794 | input, # pylint: disable=redefined-builtin |
| 1795 | filters, |
| 1796 | output_shape, |
| 1797 | strides, |
| 1798 | padding="SAME", |
| 1799 | data_format="NWC", |
| 1800 | dilations=None, |
| 1801 | name=None): |
| 1802 | """The transpose of `conv1d`. |
| 1803 | |
| 1804 | This operation is sometimes called "deconvolution" after [Deconvolutional |
| 1805 | Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf), |
| 1806 | but is really the transpose (gradient) of `conv1d` rather than an actual |
| 1807 | deconvolution. |
| 1808 | |
| 1809 | Args: |
| 1810 | input: A 3-D `Tensor` of type `float` and shape |
| 1811 | `[batch, in_width, in_channels]` for `NWC` data format or |
| 1812 | `[batch, in_channels, in_width]` for `NCW` data format. |
| 1813 | filters: A 3-D `Tensor` with the same type as `value` and shape |
| 1814 | `[filter_width, output_channels, in_channels]`. `filter`'s |
| 1815 | `in_channels` dimension must match that of `value`. |
| 1816 | output_shape: A 1-D `Tensor`, containing three elements, representing the |
| 1817 | output shape of the deconvolution op. |
| 1818 | strides: An int or list of `ints` that has length `1` or `3`. The number of |
| 1819 | entries by which the filter is moved right at each step. |
| 1820 | padding: A string, either `'VALID'` or `'SAME'`. The padding algorithm. |
| 1821 | See the "returns" section of `tf.nn.convolution` for details. |
| 1822 | data_format: A string. `'NWC'` and `'NCW'` are supported. |
| 1823 | dilations: An int or list of `ints` that has length `1` or `3` which |
| 1824 | defaults to 1. The dilation factor for each dimension of input. If set to |
| 1825 | k > 1, there will be k-1 skipped cells between each filter element on that |
| 1826 | dimension. Dilations in the batch and depth dimensions must be 1. |
| 1827 | name: Optional name for the returned tensor. |
| 1828 | |
| 1829 | Returns: |
| 1830 | A `Tensor` with the same type as `value`. |
| 1831 | |
| 1832 | Raises: |
| 1833 | ValueError: If input/output depth does not match `filter`'s shape, if |
| 1834 | `output_shape` is not at 3-element vector, if `padding` is other than |
| 1835 | `'VALID'` or `'SAME'`, or if `data_format` is invalid. |
| 1836 | """ |
| 1837 | with ops.name_scope(name, "conv1d_transpose", |
| 1838 | [input, filters, output_shape]) as name: |
| 1839 | # The format could be either NWC or NCW, map to NHWC or NCHW |
| 1840 | if data_format is None or data_format == "NWC": |
| 1841 | data_format = "NHWC" |
| 1842 | spatial_start_dim = 1 |
| 1843 | channel_index = 2 |
| 1844 | elif data_format == "NCW": |
| 1845 | data_format = "NCHW" |
| 1846 | spatial_start_dim = 2 |
| 1847 | channel_index = 1 |
| 1848 | else: |
| 1849 | raise ValueError("data_format must be \"NWC\" or \"NCW\".") |
| 1850 |
nothing calls this directly
no test coverage detected