title: Does numpy.einsum act differently on arrays loaded by cv2?
body: <p>The <a href="https://numpy.org/doc/stable/reference/generated/numpy.einsum.html" rel="nofollow noreferrer">example in numpy's documentation</a> of <code>einsum</code> says <code>np.einsum('ij-&gt;i', a)</code> functions similar to <code>np.sum(a, axis=1)</code>. Below, example 1 confirms this while example 2 contradicts it. Any idea what I am doing (expecting) wrong?</p>
  <p>Exp 1.</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  a = np.arange(25).reshape(5,5)
  b1 = np.einsum('ij-&gt;i', a)   # array([ 10,  35,  60,  85, 110])
  b2 = np.sum(a, axis=1)       # array([ 10,  35,  60,  85, 110])
  </code></pre>
  <p>Exp 2.</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import cv2
  
  img_path = &quot;path/to/an/image.png&quot;
  im = cv2.imread(img_path, cv2.IMREAD_GRAYSCALE)    # type: numpy.ndarray
  n1 = np.einsum('ij-&gt;i', im)
  n2 = np.sum(img, axis=1)
  # to show that they are different.
  print(np.max(n1), np.max(n2))  # out: 255 119630
  </code></pre>
  <p>Why <code>n1</code> and <code>n2</code> are not identical (as their <code>max</code> values indicate)?</p>