|
1 | 1 | import numpy as np
|
2 | 2 |
|
3 | 3 | def arange(start, /, *, stop=None, step=1, dtype=None, device=None):
|
| 4 | + """ |
| 5 | + Array API compatible wrapper for :py:func:`np.arange <numpy.arange>`. |
| 6 | +
|
| 7 | + See its docstring for more information. |
| 8 | + """ |
4 | 9 | if device is not None:
|
5 | 10 | # Note: Device support is not yet implemented on ndarray
|
6 | 11 | raise NotImplementedError("Device support is not yet implemented")
|
7 | 12 | return np.arange(start, stop=stop, step=step, dtype=dtype)
|
8 | 13 |
|
9 | 14 | def empty(shape, /, *, dtype=None, device=None):
|
| 15 | + """ |
| 16 | + Array API compatible wrapper for :py:func:`np.empty <numpy.empty>`. |
| 17 | +
|
| 18 | + See its docstring for more information. |
| 19 | + """ |
10 | 20 | if device is not None:
|
11 | 21 | # Note: Device support is not yet implemented on ndarray
|
12 | 22 | raise NotImplementedError("Device support is not yet implemented")
|
13 | 23 | return np.empty(shape, dtype=dtype)
|
14 | 24 |
|
15 | 25 | def empty_like(x, /, *, dtype=None, device=None):
|
| 26 | + """ |
| 27 | + Array API compatible wrapper for :py:func:`np.empty_like <numpy.empty_like>`. |
| 28 | +
|
| 29 | + See its docstring for more information. |
| 30 | + """ |
16 | 31 | if device is not None:
|
17 | 32 | # Note: Device support is not yet implemented on ndarray
|
18 | 33 | raise NotImplementedError("Device support is not yet implemented")
|
19 | 34 | return np.empty_like(x, dtype=dtype)
|
20 | 35 |
|
21 | 36 | def eye(N, /, *, M=None, k=0, dtype=None, device=None):
|
| 37 | + """ |
| 38 | + Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`. |
| 39 | +
|
| 40 | + See its docstring for more information. |
| 41 | + """ |
22 | 42 | if device is not None:
|
23 | 43 | # Note: Device support is not yet implemented on ndarray
|
24 | 44 | raise NotImplementedError("Device support is not yet implemented")
|
25 | 45 | return np.eye(N, M=M, k=k, dtype=dtype)
|
26 | 46 |
|
27 | 47 | def full(shape, fill_value, /, *, dtype=None, device=None):
|
| 48 | + """ |
| 49 | + Array API compatible wrapper for :py:func:`np.full <numpy.full>`. |
| 50 | +
|
| 51 | + See its docstring for more information. |
| 52 | + """ |
28 | 53 | if device is not None:
|
29 | 54 | # Note: Device support is not yet implemented on ndarray
|
30 | 55 | raise NotImplementedError("Device support is not yet implemented")
|
31 | 56 | return np.full(shape, fill_value, dtype=dtype)
|
32 | 57 |
|
33 | 58 | def full_like(x, fill_value, /, *, dtype=None, device=None):
|
| 59 | + """ |
| 60 | + Array API compatible wrapper for :py:func:`np.full_like <numpy.full_like>`. |
| 61 | +
|
| 62 | + See its docstring for more information. |
| 63 | + """ |
34 | 64 | if device is not None:
|
35 | 65 | # Note: Device support is not yet implemented on ndarray
|
36 | 66 | raise NotImplementedError("Device support is not yet implemented")
|
37 | 67 | return np.full_like(x, fill_value, dtype=dtype)
|
38 | 68 |
|
39 | 69 | def linspace(start, stop, num, /, *, dtype=None, device=None, endpoint=True):
|
| 70 | + """ |
| 71 | + Array API compatible wrapper for :py:func:`np.linspace <numpy.linspace>`. |
| 72 | +
|
| 73 | + See its docstring for more information. |
| 74 | + """ |
40 | 75 | if device is not None:
|
41 | 76 | # Note: Device support is not yet implemented on ndarray
|
42 | 77 | raise NotImplementedError("Device support is not yet implemented")
|
43 | 78 | return np.linspace(start, stop, num, dtype=dtype, endpoint=endpoint)
|
44 | 79 |
|
45 | 80 | def ones(shape, /, *, dtype=None, device=None):
|
| 81 | + """ |
| 82 | + Array API compatible wrapper for :py:func:`np.ones <numpy.ones>`. |
| 83 | +
|
| 84 | + See its docstring for more information. |
| 85 | + """ |
46 | 86 | if device is not None:
|
47 | 87 | # Note: Device support is not yet implemented on ndarray
|
48 | 88 | raise NotImplementedError("Device support is not yet implemented")
|
49 | 89 | return np.ones(shape, dtype=dtype)
|
50 | 90 |
|
51 | 91 | def ones_like(x, /, *, dtype=None, device=None):
|
| 92 | + """ |
| 93 | + Array API compatible wrapper for :py:func:`np.ones_like <numpy.ones_like>`. |
| 94 | +
|
| 95 | + See its docstring for more information. |
| 96 | + """ |
52 | 97 | if device is not None:
|
53 | 98 | # Note: Device support is not yet implemented on ndarray
|
54 | 99 | raise NotImplementedError("Device support is not yet implemented")
|
55 | 100 | return np.ones_like(x, dtype=dtype)
|
56 | 101 |
|
57 | 102 | def zeros(shape, /, *, dtype=None, device=None):
|
| 103 | + """ |
| 104 | + Array API compatible wrapper for :py:func:`np.zeros <numpy.zeros>`. |
| 105 | +
|
| 106 | + See its docstring for more information. |
| 107 | + """ |
58 | 108 | if device is not None:
|
59 | 109 | # Note: Device support is not yet implemented on ndarray
|
60 | 110 | raise NotImplementedError("Device support is not yet implemented")
|
61 | 111 | return np.zeros(shape, dtype=dtype)
|
62 | 112 |
|
63 | 113 | def zeros_like(x, /, *, dtype=None, device=None):
|
| 114 | + """ |
| 115 | + Array API compatible wrapper for :py:func:`np.zeros_like <numpy.zeros_like>`. |
| 116 | +
|
| 117 | + See its docstring for more information. |
| 118 | + """ |
64 | 119 | if device is not None:
|
65 | 120 | # Note: Device support is not yet implemented on ndarray
|
66 | 121 | raise NotImplementedError("Device support is not yet implemented")
|
|
0 commit comments