<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55356>55356</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Incorrect translation of numpy vector from python layer to c++ layer on Windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            stellaraccident
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sstamenova
      </td>
    </tr>
</table>

<pre>
    See https://reviews.llvm.org/D125122 for more details

The test `mlir/test/python/dialects/shape.py` fails on Windows unless we explicitly specify the type of the vector. The test expects the produced shape to look like:
```
shape.const_shape [10, 20] : tensor<2xindex>
```
Instead, on Windows, we get:
```
shape.const_shape [85899345930, 85899345930] : tensor<2xindex>
```

As far as I can tell, what's happening is that on Windows, unless the type is explicitly specified, the values are treated as a string when passing from the python layer to the C++ layer. Then the DenseElementsAttr on Windows is treated as splat resulting in the 85899345930 value (85899345930 is 0x140000000A; 0x14 is 20 and 0xA is 10). If the type is specified, everything works as expected and the DenseElementsAttr is correctly identified as not splat.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVE2PmzAQ_TVwGTUiBkI4cMhutlLOrdRj5cAQ3DU28ph8_PuOTbSbbfeyEQqewfPx3hv7aLtb8wMRBu8nSvJdIr7z4_Cs8EIrrc_jyroTu_ZrUa6FgN46GK1D6NBLpSnJ9km2W_5_DggeyUOyyUatHIcFk1_TzQ_W8KJTUmPriZc0yAlX0403Qx9SgTXwS5nOXghmo5EILgh4nbRqldc3oAlb1d_Ahzq3CcH2cX3mjNat4K0-x4Qi8ePkbDe32EGsB96CtvYVtHrFgHdpf5Pdn2gunbXWkP-9RCXl0zpLxDOILCn3wIFcyJB1Sf4srtwzXpP85dNkB86CsgvB7_iCxdhO6L_Uw7bc1nVelHUem3k0v9jV8r8jZt6BJDhAKw1Hax1bGySrVhFw4QmNMidQgU3p_8Fwl-lNEN71n14KI_golNQzEkgeH-9QelaFa0sg70KNy4AGJkkUjN7ZcREwzg5oeUMX5Au-50Q88bM4o_Am-vcMH180jmg87bx3jzMVILxXpUkzHIc0ax8BLhkeOF3ahURsH52cJbuui2z57ZL8KdrBLzKQpmNzF6wwMPUKDv0Hej5wgmd0jC5it-6VQl_L7IYeOdXnmDhNa53jbUyy6tgfM4ZoY_2CbJV2Td7VeS1Tz2Jgw-MTzyQPysHcw5kPaYh3K6aJD5OZx-l2P06LAP-S3z4S_0BuOjvdfLxETsoP85FHeGQj3CT31zc-kX-4BJuKiOeBF2WZl5t0aAop6qqq-q6uctFv2rwS2GaiXRdVKeu-SrU8oqYAJhHC4AViCl4zrlQ1IhMiK7N6vc2qvFhtt1l5rIuN6OqyPW6KpMhw5Kvm7WJLXRNbOs4n4o9akX-_9dIwiSeDeC9H4XhIJ9s2cn4vKmdmyDVEXrJC9izT2FITIf0FyGK9mA">