Skip to content

Use the main array-api-tests repo instead of my fork on CI #41

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

Merged
merged 3 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/array-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@ jobs:
- name: Checkout array-api-tests
uses: actions/checkout@v3
with:
# repository: data-apis/array-api-tests
repository: data-apis/array-api-tests
submodules: 'true'
path: array-api-tests

# Temporarily use https://github.com/data-apis/array-api-tests/pull/157
repository: asmeurer/array-api-tests
ref: xfails-file
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand Down
7 changes: 4 additions & 3 deletions array_api_compat/common/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def _asarray(

return xp.asarray(obj, dtype=dtype, **kwargs)

# xp.reshape calls the keyword argument 'newshape' instead of 'shape'
# np.reshape calls the keyword argument 'newshape' instead of 'shape'
def reshape(x: ndarray,
/,
shape: Tuple[int, ...],
Expand All @@ -340,8 +340,9 @@ def reshape(x: ndarray,
if copy is True:
x = x.copy()
elif copy is False:
x.shape = shape
return x
y = x.view()
y.shape = shape
return y
return xp.reshape(x, shape, **kwargs)

# The descending keyword is new in sort and argsort, and 'kind' replaced with
Expand Down
14 changes: 12 additions & 2 deletions array_api_compat/torch/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ def where(condition: array, x1: array, x2: array, /) -> array:
x1, x2 = _fix_promotion(x1, x2)
return torch.where(condition, x1, x2)

# torch.reshape doesn't have the copy keyword
def reshape(x: array,
/,
shape: Tuple[int, ...],
copy: Optional[bool] = None,
**kwargs) -> array:
if copy is not None:
raise NotImplementedError("torch.reshape doesn't yet support the copy keyword")
return torch.reshape(x, shape, **kwargs)

# torch.arange doesn't support returning empty arrays
# (https://github.com/pytorch/pytorch/issues/70915), and doesn't support some
# keyword argument combinations
Expand Down Expand Up @@ -659,8 +669,8 @@ def isdtype(
'logaddexp', 'multiply', 'not_equal', 'pow', 'remainder',
'subtract', 'max', 'min', 'sort', 'prod', 'sum', 'any', 'all',
'mean', 'std', 'var', 'concat', 'squeeze', 'flip', 'roll',
'nonzero', 'where', 'arange', 'eye', 'linspace', 'full', 'ones',
'zeros', 'empty', 'tril', 'triu', 'expand_dims', 'astype',
'nonzero', 'where', 'reshape', 'arange', 'eye', 'linspace', 'full',
'ones', 'zeros', 'empty', 'tril', 'triu', 'expand_dims', 'astype',
'broadcast_arrays', 'unique_all', 'unique_counts',
'unique_inverse', 'unique_values', 'matmul', 'matrix_transpose',
'vecdot', 'tensordot', 'isdtype']