Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumPy and cuNumeric behave differently in 5 cases in API concatenate #818

Closed
robinwnv opened this issue Feb 24, 2023 · 1 comment
Closed
Assignees

Comments

@robinwnv
Copy link
Contributor

robinwnv commented Feb 24, 2023

NumPy and cuNumeric behave differently for the following cases.
Some of the cases need to be fixed while the others are expected divergences.

Case-1

arrays = (1,)
num.concatenate(arrays, axis=0)
arrays = (1, 2)
num.concatenate(arrays, axis=0)

In Numpy, in both cases, it raises ValueError
In cuNumeric, in both cases, it raises IndexError

Case-2

a = [[1, 2], [3, 4]]
b = [[5, 6]]
axis = 0
out_np = np.zeros((3, 2))
out_num = num.array(out_np)
dtype = np.float32
num.concatenate((num.array(a), num.array(b)), axis=axis, out=out_num, dtype=dtype)

In Numpy, it raises TypeError as dtype cannot be provided together with out.
In cuNumeric, it pass.

Case-3

a = [[1, 2], [3, 4]]
b = [[5, 6]]
axis = 1
num.concatenate((num.array(a), num.array(b)), axis=axis)

In Numpy, it raises ValueError as along axis=0, the size of a and b are not equal.
In cuNumeric, it pass.

Case-4

a = [1, 2]
b = [5, 6]
num.concatenate((num.array(a), num.array(b)), axis=axis)

For axis = -2 or 1,
In Numpy, it raises ValueError
In cuNumeric, it raises IndexError

Case-5

a = [[1, 2], [3, 4]]
b = [[5, 6]]
num.concatenate(num.array(a), num.array(b)), axis=0, casting="unknown")

For invalid casting,
In Numpy, raise ValueError
In cuNumeric, pass

@robinwnv robinwnv changed the title NumPy and cuNumeric behave differently in 3 cases in API concatenate NumPy and cuNumeric behave differently in 5 cases in API concatenate Mar 10, 2023
robinwnv added a commit that referenced this issue Mar 31, 2023
* Fix concatenate and *stack APIs to support scalars

* Address comments
@robinwnv
Copy link
Contributor Author

robinwnv commented Apr 3, 2023

PR-844 and PR-866 fixed this issue. It's verified all tests pass. So close this issue.

@robinwnv robinwnv closed this as completed Apr 3, 2023
@robinwnv robinwnv self-assigned this Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant