RuntimeError: Expected object of scalar type Byte but got scalar type Float for argument #2 'mat2'

username: martinoywa
cooked: <p>Please help me with this. Can’t trace the error. Check comments for entire code.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/b/b21ab08eb740061ddcd50331517307d11fe80315.png" data-download-href="https://discuss.pytorch.org/uploads/default/b21ab08eb740061ddcd50331517307d11fe80315" title="error"><img src="https://discuss.pytorch.org/uploads/default/original/2X/b/b21ab08eb740061ddcd50331517307d11fe80315.png" alt="error" data-base62-sha1="ppAaFAMkgpQAwD3jsgtVEzHvw7b" width="690" height="98" data-dominant-color="F4F4F4"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">error</span><span class="informations">817×117 10.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

username: martinoywa
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/0/011064f2bde565a202e24845e5bbf408285ac71d.png" data-download-href="https://discuss.pytorch.org/uploads/default/011064f2bde565a202e24845e5bbf408285ac71d" title="error1"><img src="https://discuss.pytorch.org/uploads/default/original/2X/0/011064f2bde565a202e24845e5bbf408285ac71d.png" alt="error1" data-base62-sha1="9pBkHad1ikprnUFdrjSqfMJ6nX" width="627" height="500" data-dominant-color="F0EFEE"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">error1</span><span class="informations">828×660 47.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

username: martinoywa
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/c/c150cde72c02a98340e288f43f140b58e113d3f4.png" data-download-href="https://discuss.pytorch.org/uploads/default/c150cde72c02a98340e288f43f140b58e113d3f4" title="error2"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/c/c150cde72c02a98340e288f43f140b58e113d3f4_2_690x405.png" alt="error2" data-base62-sha1="rA9h08zBz5IuhRAsCJsdEB6e7gE" width="690" height="405" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/c/c150cde72c02a98340e288f43f140b58e113d3f4_2_690x405.png, https://discuss.pytorch.org/uploads/default/optimized/2X/c/c150cde72c02a98340e288f43f140b58e113d3f4_2_1035x607.png 1.5x, https://discuss.pytorch.org/uploads/default/original/2X/c/c150cde72c02a98340e288f43f140b58e113d3f4.png 2x" data-dominant-color="F3F4F4"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">error2</span><span class="informations">1095×644 57.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

username: martinoywa
cooked: <p>I just realized that I was missing the flattening step. It solved the problem. <img src="https://discuss.pytorch.org/images/emoji/apple/sweat_smile.png?v=9" title=":sweat_smile:" class="emoji" alt=":sweat_smile:"></p>