IntelPython / dpnp

Data Parallel Extension for NumPy
BSD 2-Clause "Simplified" License
97 stars 22 forks source link

Shape Mismatch in `linspace` Function Between `numpy` and `dpnp` #2084

Open vtavana opened 3 days ago

vtavana commented 3 days ago

There is a discrepancy in the output shape of the linspace function between numpy and dpnp.

Here is the code snippet to reproduce the issue:

import dpnp, numpy
numpy.linspace(0, [0, 1, 2, 3, 4], num=0, endpoint=False).shape
# (0, 5)

dpnp.linspace(0, [0, 1, 2, 3, 4], num=0, endpoint=False).shape
# (0,)

If endpoint=True , both functions return the same results.

import dpnp, numpy
numpy.linspace(0, [0, 1, 2, 3, 4], num=0, endpoint=True).shape
# (0, 5)

dpnp.linspace(0, [0, 1, 2, 3, 4], num=0, endpoint=True).shape
# (0, 5)