Change:
got the following err msg with conv2D and ver 0.4: RuntimeError: expected stride to be a single integer value or a list of 1 values to match the convolution dimensions, but got stride=[1, 1]. I was not able to see the problem so I uninstalled 0.4 and installed 0.3.1 Still got an err but this time it said that the expected input should be a 4d tensor and it got a 3D tensor. This helped understand the issue and I fixed it (just add a dimension). reinstalled 0.4 and its working (no surprise...). I think 0.4 should have the same err feedback otherwise its really hard to undrstand the problem How you installed PyTorch (conda, pip, source): conda Build command you used (if compiling from source): OS: macos PyTorch version: 0.4 Python version: 3.5 CUDA/cuDNN version: no GPU models and configuration: GCC version (if compiling from source): CMake version: Versions of any other relevant libraries:
Can you please post a small self-contained code snippet that would let us reproduce the problem?
The strange error messge was also mentioned a few times in the forum. Here is a code snippet for PyTorch :
This is because we direct all conv ops to and infer dim + throw error message there.
Hmm that's not great. We might want to pass the expected dimensionality of the convolution to the generic implementation, so that we can improve the error messages.
Thx for the responses. Just a reminder, for the same err the provided err msg in version 0.3.1 was very informative
Yes, this should definitely be fixed. Sorry about this!
The error message of seems to be a bit misleading, too. Code: Should I create a new issue or is it related to the current one?
that appears fixed on master! :D

Discussion:
if (weight_dim != k) { std::stringstream ss; <del> ss << "Expected " << k << "-dimensional weight for " << k << "-dimensional input " << input.sizes() << ", but got weight of size " << weight.sizes() << " instead"; </del> <ins> ss << "Expected " << weight_dim << "-dimensional input for " << weight_dim << "-dimensional weight " << weight.sizes() << ", but got input of size " << input.sizes() << " instead"; </ins> throw std::runtime_error(ss.str()); } if (weight.size(0) < groups) {

if (!transposed) { if (input.size(1) != (weight.size(1) * groups)) { std::stringstream ss; <del> ss << "Given groups=" << groups << ", weight" << weight.sizes() << ", so expected input" << input.sizes() << " to have " </del> <ins> ss << "Given groups=" << groups << ", weight of size " << weight.sizes() << ", expected input" << input.sizes() << " to have " </ins> << (weight.size(1) * groups) << " channels, but got " << input.size(1) << " channels instead"; throw std::runtime_error(ss.str());

} else { // transposed if (input.size(1) != weight.size(0)) { std::stringstream ss; <del> ss << "Given transposed=" << transposed << ", weight" << weight.sizes() << ", so expected input" << input.sizes() << " to have " </del> <ins> ss << "Given transposed=" << transposed << ", weight of size " << weight.sizes() << ", expected input" << input.sizes() << " to have " </ins> << weight.size(0) << " channels, but got " << input.size(1) << " channels instead"; throw std::runtime_error(ss.str());

auto input = input_r.contiguous(); auto weight = weight_r; auto bias = bias_r; <del> auto k = input.ndimension(); </del> <ins> auto k = weight.ndimension(); </ins> int64_t dim = k - 2; if (dim <= 0) { <del> throw std::runtime_error("input has less dimensions than expected"); </del> <ins> throw std::runtime_error("weight should have at least two dimensions"); </ins> } ConvParams params;