Given an input tensor of shape
[batch, in_width, in_channels]
if data_format is "NWC", or
[batch, in_channels, in_width]
if data_format is "NCW",
and a filter / kernel tensor of shape
[filter_width, in_channels, out_channels], this op reshapes
the arguments to pass them to conv2d to perform the equivalent
convolution operation.
Internally, this op reshapes the input tensors and invokes tf.nn.conv2d.
For example, if data_format does not start with "NC", a tensor of shape
[batch, in_width, in_channels]
is reshaped to
[batch, 1, in_width, in_channels],
and the filter is reshaped to
[1, filter_width, in_channels, out_channels].
The result is then reshaped back to
[batch, out_width, out_channels]
(where out_width is a function of the stride and padding as in conv2d) and
returned to the caller.
Args
value
A 3D Tensor. Must be of type float16, float32, or float64.
filters
A 3D Tensor. Must have the same type as value.
stride
An int or list of ints that has length 1 or 3. The number of
entries by which the filter is moved right at each step.
padding
'SAME' or 'VALID'
use_cudnn_on_gpu
An optional bool. Defaults to True.
data_format
An optional string from "NWC", "NCW". Defaults to "NWC",
the data is stored in the order of [batch, in_width, in_channels]. The
"NCW" format stores data as [batch, in_channels, in_width].
name
A name for the operation (optional).
input
Alias for value.
dilations
An int or list of ints that has length 1 or 3 which
defaults to 1. The dilation factor for each dimension of input. If set to
k > 1, there will be k-1 skipped cells between each filter element on that
dimension. Dilations in the batch and depth dimensions must be 1.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.nn.conv1d\n\n|-------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/nn/conv1d) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/nn_ops.py#L1587-L1682) |\n\nComputes a 1-D convolution given 3-D input and filter tensors. (deprecated argument values) (deprecated argument values)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.nn.conv1d`](/api_docs/python/tf/compat/v1/nn/conv1d)\n\n\u003cbr /\u003e\n\n tf.nn.conv1d(\n value=None, filters=None, stride=None, padding=None, use_cudnn_on_gpu=None,\n data_format=None, name=None, input=None, dilations=None\n )\n\n| **Warning:** SOME ARGUMENT VALUES ARE DEPRECATED: `(data_format='NCHW')`. They will be removed in a future version. Instructions for updating: `NCHW` for data_format is deprecated, use `NCW` instead\n| **Warning:** SOME ARGUMENT VALUES ARE DEPRECATED: `(data_format='NHWC')`. They will be removed in a future version. Instructions for updating: `NHWC` for data_format is deprecated, use `NWC` instead\n\nGiven an input tensor of shape\n\\[batch, in_width, in_channels\\]\nif data_format is \"NWC\", or\n\\[batch, in_channels, in_width\\]\nif data_format is \"NCW\",\nand a filter / kernel tensor of shape\n\\[filter_width, in_channels, out_channels\\], this op reshapes\nthe arguments to pass them to conv2d to perform the equivalent\nconvolution operation.\n\nInternally, this op reshapes the input tensors and invokes [`tf.nn.conv2d`](../../tf/nn/conv2d).\nFor example, if `data_format` does not start with \"NC\", a tensor of shape\n\\[batch, in_width, in_channels\\]\nis reshaped to\n\\[batch, 1, in_width, in_channels\\],\nand the filter is reshaped to\n\\[1, filter_width, in_channels, out_channels\\].\nThe result is then reshaped back to\n\\[batch, out_width, out_channels\\]\n(where out_width is a function of the stride and padding as in conv2d) and\nreturned to the caller.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | A 3D `Tensor`. Must be of type `float16`, `float32`, or `float64`. |\n| `filters` | A 3D `Tensor`. Must have the same type as `value`. |\n| `stride` | An int or list of `ints` that has length `1` or `3`. The number of entries by which the filter is moved right at each step. |\n| `padding` | 'SAME' or 'VALID' |\n| `use_cudnn_on_gpu` | An optional `bool`. Defaults to `True`. |\n| `data_format` | An optional `string` from `\"NWC\", \"NCW\"`. Defaults to `\"NWC\"`, the data is stored in the order of \\[batch, in_width, in_channels\\]. The `\"NCW\"` format stores data as \\[batch, in_channels, in_width\\]. |\n| `name` | A name for the operation (optional). |\n| `input` | Alias for value. |\n| `dilations` | An int or list of `ints` that has length `1` or `3` which defaults to 1. The dilation factor for each dimension of input. If set to k \\\u003e 1, there will be k-1 skipped cells between each filter element on that dimension. Dilations in the batch and depth dimensions must be 1. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor`. Has the same type as input. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|------------------------------|\n| `ValueError` | if `data_format` is invalid. |\n\n\u003cbr /\u003e"]]