title: Pytorch: why does torch.where method does not work like numpy.where?
body: <p>In order to replace positive values with a certain number and negative ones with another number in a random vector using <code>Numpy</code> one can do the following:</p>
  <pre><code>npy_p = np.random.randn(4,6)
  quant = np.where(npy_p&gt;0, c_plus , np.where(npy_p&lt;0, c_minus , npy_p))
  </code></pre>
  <p>However <code>where</code> method in <code>Pytorch</code> throws out the following error:</p>
  <blockquote>
  <p>expected scalar type double but found float</p>
  </blockquote>
  <p>Can you help me with that?</p>