# Is there a difference between tf.nn.conv1d and tf.nn.convolution in Tensorflow?

I want to know what is the difference between a these two. For me, they are the same function, so I do not see the reason of existance two same functions.

In TensorFlow 2, they accept different arguments:

tf.nn.convolution(input,...)

Computes sums of N-D convolutions (actually cross-correlation).

input: An (N+2)-D Tensor of type T, of shape [batch_size] + input_spatial_shape + [in_channels]

While the second one is more specific:

tf.nn.conv1d(input,...)

Computes a 1-D convolution given 3-D input and filter tensors.

input: A 3D Tensor.input: A 3D Tensor.

• Thank you for your answer. So, basically, both in some case, e.g. 3D tensor input, are computing the same thing? – Cepeline Jan 29 at 15:15
• I don't know for sure. I believe you can check it by feeding a 3D tensor to both. – homocomputeris Jan 30 at 11:38