Skip to content

Conv1D Multichannel broken #23042

@jamarshon

Description

@jamarshon

Steps to produce

I run the following code with two setups. Basically, it is convolution on a multichannel tensor (2, 8024) versus running convolution on the same tensor but with only one channel (1, 8024).

def conv(i, w):
	conv_stride = 2
	num_channels = i.size(0)
	return torch.nn.functional.conv1d(
		i.unsqueeze(0), w.repeat(num_channels, 1, 1),
        stride=conv_stride, groups=num_channels).squeeze(0)

torch.manual_seed(0)
i1 = torch.rand((2, 8024))*1e2
w1 = torch.rand(25)*1e2

conv1 = conv(i1, w1)  # (2, 4000)
conv2 = conv(i1[0,:].unsqueeze(0), w1)  # (1, 4000)

print('conv error %.16f' % ((conv1[0,:] - conv2[0,:]).abs().max()))

On the first setup, I use

conda create --name six python=3.7
conda activate six
conda install pytorch-nightly=1.2.0.dev20190615 -c pytorch

and get conv error 0.0000000000000000 as expected

For the second setup, I use

conda create --name seven python=3.7
conda activate seven
conda install pytorch-nightly=1.2.0.dev20190718 -c pytorch

and get conv error 0.0234375000000000 which is not correct.

Environment

Collecting environment information...
PyTorch version: 1.2.0.dev20190718
Is debug build: No
CUDA used to build PyTorch: Could not collect
OS: Mac OSX 10.14.5
GCC version: Could not collect
CMake version: version 3.14.0
Python version: 3.7
Is CUDA available: No
CUDA runtime version: Could not collect
GPU models and configuration: Could not collect
Nvidia driver version: 1.1.0
cuDNN version: Could not collect
Versions of relevant libraries:
[pip] numpy==1.16.4
[pip] torch==1.2.0.dev20190718
[conda] mkl 2019.4 233
[conda] pytorch-nightly 1.2.0.dev20190718 py3.7_0 pytorch

Metadata

Metadata

Assignees

Labels

high prioritymodule: convolutionProblems related to convolutions (THNN, THCUNN, CuDNN)module: nnRelated to torch.nntriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions