Check out example codes for "RuntimeError: size mismatch, m1: [1536 x 3], m2: [4096 x 101] at /opt/conda/conda-bld/pytorch_1587428398394/work/aten/src/TH/generic/THTensorMath.cpp:41". It will help you in understanding the concepts better.

Code Example 1

RuntimeError: size mismatch, m1: [a x b], m2: [c x d]

Code Example 2

img = img.view(1, -1) # converts [3 x 256 x 256] to 1 x 196608
output = model(img)

Learn ReactJs, React Native from akashmittal.com