8000 ENH: Make numpy.array_api more portable by asmeurer · Pull Request #25370 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Make numpy.array_api more portable #25370

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 12 commits into from
Jan 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Fix the array_api fft creation functions to use the custom CPU_DEVICE…
… object
  • Loading branch information
asmeurer committed Jan 17, 2024
commit 7f354e500f85ec335dba4fdb53bd764c777965c0
6 changes: 3 additions & 3 deletions numpy/array_api/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
float32,
complex64,
)
from ._array_object import Array
from ._array_object import Array, CPU_DEVICE
from ._data_type_functions import astype

import numpy as np
Expand Down Expand Up @@ -244,7 +244,7 @@ def fftfreq(n: int, /, *, d: float = 1.0, device: Optional[Device] = None) -> Ar

See its docstring for more information.
"""
if device not in ["cpu", None]:
if device not in [CPU_DEVICE, None]:
raise ValueError(f"Unsupported device {device!r}")
return Array._new(np.fft.fftfreq(n, d=d))

Expand All @@ -254,7 +254,7 @@ def rfftfreq(n: int, /, *, d: float = 1.0, device: Optional[Device] = None) -> A

See its docstring for more information.
"""
if device not in ["cpu", None]:
if device not in [CPU_DEVICE, None]:
raise ValueError(f"Unsupported device {device!r}")
return Array._new(np.fft.rfftfreq(n, d=d))

Expand Down
0