Hi,
Could please sure a code that can reproduces this error?
The problem is torch.dot() only supports 1D tensors. So, the error should be about it. The alternatives function for 2D and 3D (batch-wise) is torch.mm and torch.bmm respectively.
Here is the code I used to produce your case (although could not get your error):
a = torch.randint(high=10, size=(5, 7), dtype=torch.int16)
b = torch.randint(high=10, size=(5, 7), dtype=torch.int16)
torch.dot(a, torch.t(b))

# output 
# RuntimeError: 1D tensors expected, got 2D, 2D tensors at /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:431

Maybe you are using an old version of PyTorch?