Torch.dot issue v0.2

Error after upgrading to v0.2

RuntimeError: Expected argument self to have 1 dimension(s), but has 4 at /opt/conda/conda-bld/pytorch_1502006348621/work/torch/csrc/generic/TensorMethods.cpp:23086

Line that has issue
torch.dot(tensor_1, tensor_2)

  • tensor_1 size: (512L, 256L, 3L, 3L)
  • tensor_2 size: (512L, 256L, 3L, 3L)

Used to work prior to v0.2 (I downgraded to 0.1.12 and it worked) @Soumith_Chintala

Can you open an issue at https://github.com/pytorch/pytorch/issues/
Looks like we removed implicit flattening, and Gregory Chanan will reply with either the reason, or issue a fix.

For now you can do:

torch.dot(tensor_1.view(-1), tensor_2.view(-1))
1 Like

Indeed, there was a valid reason: https://github.com/pytorch/pytorch/issues/2313