Solved by royboy in post #4 
              
              
                The behavior of calling mean on an uninitialized tensor is undefined. I believe pytorch is interpreting the data as if it were valid numbers, which is why you get a result. However, there’s no guarantees for the data that is going to be in the tensor, so that’s why you get such unpredictable results…