title: Different results using sign with mean in pytorch
body: <p>I used the following code in two different applications on two different platforms and got different results.
  b is a vector of dimensions [w,3,200,200] Where w is the batch-size</p>
  <pre><code>grad=b.sign()
  
  grad=torch.mean(grad,dim=0)
  </code></pre>
  <p>In one case i got what i expected as output from the final grad of + and - 0,222 and 0,333 etc, while in the other case i got a vector of + and - 1's
  It turns out that what i expected got me no improvement in accuracy in the final model, while the case with + and - 1's got excellent accuracy.</p>
  <p>So i am trying to replicate the case with + and - 1's but i seem to be getting + and - 0.222's and 0.333's instead.
  What could cause such a discrepancy in calculation? could it be python or pytorch version? i tried it both on GPU and CPU with no change. i tried changing the code to calculate the torch.mode() instead but there was no increase in accuracy. Please help.</p>