I
Dear all, I have a simple highway CNN with three highway 1d conv  layers, my input size is 22 dimensions, it views as x= x.view(batch, 1, seq_lng) before input for the first conv layer, where, batch szie is 128, seq_length is 142.   To make the input szie equal to the output size, i used the padding with 1, num_filters or channel  10, filter_size is 3: The shape of tensors look like as:
128,1,242 for input x
128,10,242 after the first highway conv layer
128,10,242 after the second highway conv layer
128,10,242 after the third highway conv layer
Then i make to flatten output of the last highway conv layer to give as an input for the FCL as:
x = x.view(-1, channel x width)
size is 128 x 2420 as an input dimension for FCL and 1024 output dimension
However, when i run, the dimension mismatch occurred as follows:
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py", line 1352, in linear
    ret = torch.addmm(torch.jit._unwrap_optional(bias), input, weight.t())
RuntimeError: size mismatch, m1: [128 x 2420], m2: [370 x 1024] at /opt/conda/conda-bld/pytorch_1549628766161/work/aten/src/THC/generic/THCTensorMathBlas.cu:266

Can you please tell me why this is happened? And How can i fix it?