This is the first place I ended up in when searching the error: matrices expected, got 1D, 2D tensors at /py/conda-bld/pytorch_1490983232023/work/torch/lib/TH/generic/THTensorMath.c:1224
And even from smth’s comment and the documentation I’d say it’s not immediately obvious that the solution, at least in my case, is that the dimensionality of the input needed to be 3D rather than 2D. It does explain why .view() makes frequent appearances in some of the tutorials.