We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ff7366 commit bb5da85Copy full SHA for bb5da85
array_api_compat/common/_helpers.py
@@ -54,6 +54,13 @@ def get_namespace(*xs, _use_compat=True):
54
Get the array API compatible namespace for the arrays `xs`.
55
56
`xs` should contain one or more arrays.
57
+
58
+ Typical usage is
59
60
+ def your_function(x, y):
61
+ xp = array_api_compat.get_namespace(x, y)
62
+ # Now use xp as the array library namespace
63
+ return xp.mean(x, axis=0) + 2*xp.std(y, axis=0)
64
"""
65
namespaces = set()
66
for x in xs:
0 commit comments