Solved by dskhudia in post #6 
              
              
                @SoufSilence, 
Actual result of the operation is -63 and since output tensor is of type torch.quint8, thus the result need to be in the range [0, 255]. Therefore, -63 gets converted to the nearest number in this range. 
If you pick the following numbers (I changed -59 to 59 in w), you get the result…