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

implement dpnp.matvec and dpnp.vecmat #2288

Merged
merged 6 commits into from
Feb 5, 2025
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
2 changes: 2 additions & 0 deletions doc/reference/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Matrix and vector products
dpnp.outer
dpnp.matmul
dpnp.linalg.matmul (Array API compatible)
dpnp.matvec
dpnp.vecmat
dpnp.tensordot
dpnp.linalg.tensordot (Array API compatible)
dpnp.einsum
Expand Down
33 changes: 27 additions & 6 deletions dpnp/dpnp_iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,25 @@ def as_usm_ndarray(a, dtype=None, device=None, usm_type=None, sycl_queue=None):
)


def check_limitations(subok=False, like=None, initial=None, where=True):
def check_limitations(
subok=False,
like=None,
initial=None,
where=True,
subok_linalg=True,
signature=None,
):
"""
Checking limitation kwargs for their supported values.

Parameter `subok` is only supported with default value ``False``.
Parameter `subok` for array creation functions is only supported with
default value ``False``.
Parameter `like` is only supported with default value ``None``.
Parameter `initial` is only supported with default value ``None``.
Parameter `where` is only supported with default value ``True``.
Parameter `subok` for linear algebra functions, named as `subok_linalg`
here, and is only supported with default value ``True``.
Parameter `signature` is only supported with default value ``None``.

Raises
------
Expand All @@ -341,22 +352,32 @@ def check_limitations(subok=False, like=None, initial=None, where=True):
if like is not None:
raise NotImplementedError(
"Keyword argument `like` is supported only with "
f"default value ``None``, but got {like}"
f"default value ``None``, but got {like}."
)
if subok is not False:
raise NotImplementedError(
"Keyword argument `subok` is supported only with "
f"default value ``False``, but got {subok}"
f"default value ``False``, but got {subok}."
)
if initial is not None:
raise NotImplementedError(
"Keyword argument `initial` is only supported with "
f"default value ``None``, but got {initial}"
f"default value ``None``, but got {initial}."
)
if where is not True:
raise NotImplementedError(
"Keyword argument `where` is supported only with "
f"default value ``True``, but got {where}"
f"default value ``True``, but got {where}."
)
if not subok_linalg:
raise NotImplementedError(
"keyword argument `subok` is only supported with "
f"default value ``True``, but got {subok_linalg}."
)
if signature is not None:
raise NotImplementedError(
"keyword argument `signature` is only supported with "
f"default value ``None``, but got {signature}."
)


Expand Down
Loading
Loading