I have a 3D tensor A =  [4 x 10 x 128] and a 2D tensor  B = [ 4 x 10]. I want to multiply them and have a 3D tensor C = [1 x 10 x 128].
Currently I am trying this:
result = torch.mm(A.view(-1, 4), B)
result = result.view(1, 10, 128)
But I get an error  that the size [1 x 10 x 128] is invalid for input with 12800 elements.
Any suggestions?