array-api-tests icon indicating copy to clipboard operation
array-api-tests copied to clipboard

Test new `copy` arg in `test_reshape`

Open honno opened this issue 3 years ago • 1 comments

Low prio until we get an actually implementation that supports the copy kwarg properly in asarray(), let alone reshape(). A util should be created to refactor what was already done for test_asarray_arrays: https://github.com/data-apis/array-api-tests/blob/63ebadb9decd15340dabeb8ed9f5ba5748024f9d/array_api_tests/test_creation_functions.py#L270

honno avatar Mar 23 '22 10:03 honno

I'm implementing this in the numpy_array_api_compat library. A real test would be nice. It shouldn't be difficult to do. If the new shape is different, just check that the returned array has a different shape. If it's the same, we can do a check similar to the one in test_asarray. The None case cannot be tested because it depends on implementation details (like if the underlying library uses strides/views).

asmeurer avatar Oct 06 '22 03:10 asmeurer