-
Notifications
You must be signed in to change notification settings - Fork 23
Add property flags to dpnp_array #1265
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
Conversation
tests/test_dparray.py
Outdated
expected = dpt.usm_ndarray(shape, order=order) | ||
result = dpnp.ndarray(shape, order=order) | ||
assert expected.flags == result.flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if to extend the test (or add additional one), where to compare flags with numpy array? like:
expected = dpt.usm_ndarray(shape, order=order) | |
result = dpnp.ndarray(shape, order=order) | |
assert expected.flags == result.flags | |
usm_array = dpt.usm_ndarray(shape, order=order) | |
numpy_array = numpy.ndarray(shape, order=order) | |
dpnp_array = dpnp.ndarray(shape, order=order) | |
assert usm_array.flags == dpnp_array.flags | |
assert numpy_array.flags.c_contiguous == dpnp_array.flags.c_contiguous | |
assert numpy_array.flags.f_contiguous == dpnp_array.flags.f_contiguous |
@pytest.mark.parametrize("order", | ||
["C", "F"], | ||
ids=['C', 'F']) | ||
def test_flags(shape, order): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, also it would be good to add a test of flags with different strides.
Added property flags to dpnp_array by using dpctl.tensor.usm_ndarray.flags.