zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
U
O±dcã@sòddlmZddlmZmZmZmZmZmZddl    m
Z
ddl Z dddœdd    „Z dddœd
d „Zdddœd d „Zddddœdd„Zdddœdd„Zdddœdd„Zdddœdd„Zddddœdd„Zdddœdd„Zddddœdd„Zddddœdd„Zdddœdd „Zddddœd!d"„Zddddœd#d$„Zddddœd%d&„Zdddœd'd(„Zdddœd)d*„Zdddœd+d,„Zddddœd-d.„Zddddœd/d0„Z dddœd1d2„Z!dddœd3d4„Z"dddœd5d6„Z#ddddœd7d8„Z$ddddœd9d:„Z%ddddœd;d<„Z&dddœd=d>„Z'dddœd?d@„Z(dddœdAdB„Z)ddddœdCdD„Z*ddddœdEdF„Z+dddœdGdH„Z,dddœdIdJ„Z-dddœdKdL„Z.dddœdMdN„Z/ddddœdOdP„Z0ddddœdQdR„Z1dddœdSdT„Z2ddddœdUdV„Z3ddddœdWdX„Z4ddddœdYdZ„Z5dddœd[d\„Z6ddddœd]d^„Z7dddœd_d`„Z8ddddœdadb„Z9ddddœdcdd„Z:dddœdedf„Z;dddœdgdh„Z<dddœdidj„Z=dddœdkdl„Z>dddœdmdn„Z?dddœdodp„Z@ddddœdqdr„ZAdddœdsdt„ZBdddœdudv„ZCdddœdwdx„ZDdS)yé)Ú annotationsé)Ú_boolean_dtypesÚ_floating_dtypesÚ_integer_dtypesÚ_integer_or_boolean_dtypesÚ_numeric_dtypesÚ _result_type)ÚArrayNr
)ÚxÚreturncCs$|jtkrtdƒ‚t t |j¡¡S)zv
    Array API compatible wrapper for :py:func:`np.abs <numpy.abs>`.
 
    See its docstring for more information.
    z&Only numeric dtypes are allowed in abs)ÚdtyperÚ    TypeErrorr
Ú_newÚnpÚabsÚ_array©r ©rú]d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/array_api/_elementwise_functions.pyrs
rcCs$|jtkrtdƒ‚t t |j¡¡S)z|
    Array API compatible wrapper for :py:func:`np.arccos <numpy.arccos>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in acos)r rrr
rrZarccosrrrrrÚacoss
rcCs$|jtkrtdƒ‚t t |j¡¡S)z~
    Array API compatible wrapper for :py:func:`np.arccosh <numpy.arccosh>`.
 
    See its docstring for more information.
    z/Only floating-point dtypes are allowed in acosh)r rrr
rrZarccoshrrrrrÚacosh(s
r)Úx1Úx2r cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)zv
    Array API compatible wrapper for :py:func:`np.add <numpy.add>`.
 
    See its docstring for more information.
    z&Only numeric dtypes are allowed in add)
r rrr    r
Ú_normalize_two_argsrrÚaddr©rrrrrr3s
rcCs$|jtkrtdƒ‚t t |j¡¡S)z|
    Array API compatible wrapper for :py:func:`np.arcsin <numpy.arcsin>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in asin)r rrr
rrZarcsinrrrrrÚasinBs
rcCs$|jtkrtdƒ‚t t |j¡¡S)z~
    Array API compatible wrapper for :py:func:`np.arcsinh <numpy.arcsinh>`.
 
    See its docstring for more information.
    z/Only floating-point dtypes are allowed in asinh)r rrr
rrZarcsinhrrrrrÚasinhNs
rcCs$|jtkrtdƒ‚t t |j¡¡S)z|
    Array API compatible wrapper for :py:func:`np.arctan <numpy.arctan>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in atan)r rrr
rrZarctanrrrrrÚatanZs
rcCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z~
    Array API compatible wrapper for :py:func:`np.arctan2 <numpy.arctan2>`.
 
    See its docstring for more information.
    z/Only floating-point dtypes are allowed in atan2)
r rrr    r
rrrZarctan2rrrrrÚatan2fs
r cCs$|jtkrtdƒ‚t t |j¡¡S)z~
    Array API compatible wrapper for :py:func:`np.arctanh <numpy.arctanh>`.
 
    See its docstring for more information.
    z/Only floating-point dtypes are allowed in atanh)r rrr
rrZarctanhrrrrrÚatanhus
r!cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z†
    Array API compatible wrapper for :py:func:`np.bitwise_and <numpy.bitwise_and>`.
 
    See its docstring for more information.
    z9Only integer or boolean dtypes are allowed in bitwise_and)
r rrr    r
rrrÚ bitwise_andrrrrrr"€sÿþr"cCsh|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t |jdk¡rRt    dƒ‚t 
t  |j|j¡¡S)z„
    Array API compatible wrapper for :py:func:`np.left_shift <numpy.left_shift>`.
 
    See its docstring for more information.
    z5Only integer dtypes are allowed in bitwise_left_shiftrz6bitwise_left_shift(x1, x2) is only defined for x2 >= 0) r rrr    r
rrÚanyrÚ
ValueErrorrZ
left_shiftrrrrÚbitwise_left_shift’sr%cCs$|jtkrtdƒ‚t t |j¡¡S)z|
    Array API compatible wrapper for :py:func:`np.invert <numpy.invert>`.
 
    See its docstring for more information.
    z<Only integer or boolean dtypes are allowed in bitwise_invert)r rrr
rrÚinvertrrrrrÚbitwise_invert¤s
r'cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z„
    Array API compatible wrapper for :py:func:`np.bitwise_or <numpy.bitwise_or>`.
 
    See its docstring for more information.
    z8Only integer or boolean dtypes are allowed in bitwise_or)
r rrr    r
rrrÚ
bitwise_orrrrrrr(¯sÿþr(cCsh|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t |jdk¡rRt    dƒ‚t 
t  |j|j¡¡S)z†
    Array API compatible wrapper for :py:func:`np.right_shift <numpy.right_shift>`.
 
    See its docstring for more information.
    z6Only integer dtypes are allowed in bitwise_right_shiftrz7bitwise_right_shift(x1, x2) is only defined for x2 >= 0) r rrr    r
rrr#rr$rZ right_shiftrrrrÚbitwise_right_shiftÁsr)cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z†
    Array API compatible wrapper for :py:func:`np.bitwise_xor <numpy.bitwise_xor>`.
 
    See its docstring for more information.
    z9Only integer or boolean dtypes are allowed in bitwise_xor)
r rrr    r
rrrÚ bitwise_xorrrrrrr*Òsÿþr*cCs2|jtkrtdƒ‚|jtkr |St t |j¡¡S)zx
    Array API compatible wrapper for :py:func:`np.ceil <numpy.ceil>`.
 
    See its docstring for more information.
    z'Only numeric dtypes are allowed in ceil)    r rrrr
rrÚceilrrrrrr+ãs
 
 
r+cCs$|jtkrtdƒ‚t t |j¡¡S)zv
    Array API compatible wrapper for :py:func:`np.cos <numpy.cos>`.
 
    See its docstring for more information.
    z-Only floating-point dtypes are allowed in cos)r rrr
rrÚcosrrrrrr,ñs
r,cCs$|jtkrtdƒ‚t t |j¡¡S)zx
    Array API compatible wrapper for :py:func:`np.cosh <numpy.cosh>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in cosh)r rrr
rrÚcoshrrrrrr-üs
r-cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z|
    Array API compatible wrapper for :py:func:`np.divide <numpy.divide>`.
 
    See its docstring for more information.
    z0Only floating-point dtypes are allowed in divide)
r rrr    r
rrrÚdividerrrrrr.s
r.cCs4t|j|jƒt ||¡\}}t t |j|j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.equal <numpy.equal>`.
 
    See its docstring for more information.
    )r    r r
rrrÚequalrrrrrr/sr/cCs$|jtkrtdƒ‚t t |j¡¡S)zv
    Array API compatible wrapper for :py:func:`np.exp <numpy.exp>`.
 
    See its docstring for more information.
    z-Only floating-point dtypes are allowed in exp)r rrr
rrÚexprrrrrr0!s
r0cCs$|jtkrtdƒ‚t t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.expm1 <numpy.expm1>`.
 
    See its docstring for more information.
    z/Only floating-point dtypes are allowed in expm1)r rrr
rrÚexpm1rrrrrr1,s
r1cCs2|jtkrtdƒ‚|jtkr |St t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.floor <numpy.floor>`.
 
    See its docstring for more information.
    z(Only numeric dtypes are allowed in floor)    r rrrr
rrÚfloorrrrrrr27s
 
 
r2cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)zˆ
    Array API compatible wrapper for :py:func:`np.floor_divide <numpy.floor_divide>`.
 
    See its docstring for more information.
    z/Only numeric dtypes are allowed in floor_divide)
r rrr    r
rrrÚ floor_dividerrrrrr3Es
r3cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z~
    Array API compatible wrapper for :py:func:`np.greater <numpy.greater>`.
 
    See its docstring for more information.
    z*Only numeric dtypes are allowed in greater)
r rrr    r
rrrÚgreaterrrrrrr4Ss
r4cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)zŠ
    Array API compatible wrapper for :py:func:`np.greater_equal <numpy.greater_equal>`.
 
    See its docstring for more information.
    z0Only numeric dtypes are allowed in greater_equal)
r rrr    r
rrrÚ greater_equalrrrrrr5as
r5cCs$|jtkrtdƒ‚t t |j¡¡S)z€
    Array API compatible wrapper for :py:func:`np.isfinite <numpy.isfinite>`.
 
    See its docstring for more information.
    z+Only numeric dtypes are allowed in isfinite)r rrr
rrÚisfiniterrrrrr6os
r6cCs$|jtkrtdƒ‚t t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.isinf <numpy.isinf>`.
 
    See its docstring for more information.
    z(Only numeric dtypes are allowed in isinf)r rrr
rrÚisinfrrrrrr7zs
r7cCs$|jtkrtdƒ‚t t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.isnan <numpy.isnan>`.
 
    See its docstring for more information.
    z(Only numeric dtypes are allowed in isnan)r rrr
rrÚisnanrrrrrr8…s
r8cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)zx
    Array API compatible wrapper for :py:func:`np.less <numpy.less>`.
 
    See its docstring for more information.
    z'Only numeric dtypes are allowed in less)
r rrr    r
rrrÚlessrrrrrr9s
r9cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z„
    Array API compatible wrapper for :py:func:`np.less_equal <numpy.less_equal>`.
 
    See its docstring for more information.
    z-Only numeric dtypes are allowed in less_equal)
r rrr    r
rrrÚ
less_equalrrrrrr:žs
r:cCs$|jtkrtdƒ‚t t |j¡¡S)zv
    Array API compatible wrapper for :py:func:`np.log <numpy.log>`.
 
    See its docstring for more information.
    z-Only floating-point dtypes are allowed in log)r rrr
rrÚlogrrrrrr;¬s
r;cCs$|jtkrtdƒ‚t t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.log1p <numpy.log1p>`.
 
    See its docstring for more information.
    z/Only floating-point dtypes are allowed in log1p)r rrr
rrÚlog1prrrrrr<·s
r<cCs$|jtkrtdƒ‚t t |j¡¡S)zx
    Array API compatible wrapper for :py:func:`np.log2 <numpy.log2>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in log2)r rrr
rrÚlog2rrrrrr=Âs
r=cCs$|jtkrtdƒ‚t t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.log10 <numpy.log10>`.
 
    See its docstring for more information.
    z/Only floating-point dtypes are allowed in log10)r rrr
rrÚlog10rrrrrr>Ís
r>cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z‚
    Array API compatible wrapper for :py:func:`np.logaddexp <numpy.logaddexp>`.
 
    See its docstring for more information.
    z3Only floating-point dtypes are allowed in logaddexp)
r rrr    r
rrrÚ    logaddexprrrrrr?Øs
r?cCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z†
    Array API compatible wrapper for :py:func:`np.logical_and <numpy.logical_and>`.
 
    See its docstring for more information.
    z.Only boolean dtypes are allowed in logical_and)
r rrr    r
rrrÚ logical_andrrrrrr@æs
r@cCs$|jtkrtdƒ‚t t |j¡¡S)z†
    Array API compatible wrapper for :py:func:`np.logical_not <numpy.logical_not>`.
 
    See its docstring for more information.
    z.Only boolean dtypes are allowed in logical_not)r rrr
rrÚ logical_notrrrrrrAôs
rAcCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z„
    Array API compatible wrapper for :py:func:`np.logical_or <numpy.logical_or>`.
 
    See its docstring for more information.
    z-Only boolean dtypes are allowed in logical_or)
r rrr    r
rrrÚ
logical_orrrrrrrBÿs
rBcCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z†
    Array API compatible wrapper for :py:func:`np.logical_xor <numpy.logical_xor>`.
 
    See its docstring for more information.
    z.Only boolean dtypes are allowed in logical_xor)
r rrr    r
rrrÚ logical_xorrrrrrrC s
rCcCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z€
    Array API compatible wrapper for :py:func:`np.multiply <numpy.multiply>`.
 
    See its docstring for more information.
    z+Only numeric dtypes are allowed in multiply)
r rrr    r
rrrÚmultiplyrrrrrrDs
rDcCs$|jtkrtdƒ‚t t |j¡¡S)z€
    Array API compatible wrapper for :py:func:`np.negative <numpy.negative>`.
 
    See its docstring for more information.
    z+Only numeric dtypes are allowed in negative)r rrr
rrÚnegativerrrrrrE)s
rEcCs4t|j|jƒt ||¡\}}t t |j|j¡¡S)z‚
    Array API compatible wrapper for :py:func:`np.not_equal <numpy.not_equal>`.
 
    See its docstring for more information.
    )r    r r
rrrÚ    not_equalrrrrrrF4srFcCs$|jtkrtdƒ‚t t |j¡¡S)z€
    Array API compatible wrapper for :py:func:`np.positive <numpy.positive>`.
 
    See its docstring for more information.
    z+Only numeric dtypes are allowed in positive)r rrr
rrÚpositiverrrrrrG@s
rGcCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)zz
    Array API compatible wrapper for :py:func:`np.power <numpy.power>`.
 
    See its docstring for more information.
    z&Only numeric dtypes are allowed in pow)
r rrr    r
rrrÚpowerrrrrrÚpowLs
rIcCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z‚
    Array API compatible wrapper for :py:func:`np.remainder <numpy.remainder>`.
 
    See its docstring for more information.
    z,Only numeric dtypes are allowed in remainder)
r rrr    r
rrrÚ    remainderrrrrrrJZs
rJcCs$|jtkrtdƒ‚t t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.round <numpy.round>`.
 
    See its docstring for more information.
    z(Only numeric dtypes are allowed in round)r rrr
rrÚroundrrrrrrKhs
rKcCs$|jtkrtdƒ‚t t |j¡¡S)zx
    Array API compatible wrapper for :py:func:`np.sign <numpy.sign>`.
 
    See its docstring for more information.
    z'Only numeric dtypes are allowed in sign)r rrr
rrÚsignrrrrrrLss
rLcCs$|jtkrtdƒ‚t t |j¡¡S)zv
    Array API compatible wrapper for :py:func:`np.sin <numpy.sin>`.
 
    See its docstring for more information.
    z-Only floating-point dtypes are allowed in sin)r rrr
rrÚsinrrrrrrM~s
rMcCs$|jtkrtdƒ‚t t |j¡¡S)zx
    Array API compatible wrapper for :py:func:`np.sinh <numpy.sinh>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in sinh)r rrr
rrÚsinhrrrrrrN‰s
rNcCs$|jtkrtdƒ‚t t |j¡¡S)z|
    Array API compatible wrapper for :py:func:`np.square <numpy.square>`.
 
    See its docstring for more information.
    z)Only numeric dtypes are allowed in square)r rrr
rrÚsquarerrrrrrO”s
rOcCs$|jtkrtdƒ‚t t |j¡¡S)zx
    Array API compatible wrapper for :py:func:`np.sqrt <numpy.sqrt>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in sqrt)r rrr
rrÚsqrtrrrrrrPŸs
rPcCsP|jtks|jtkrtdƒ‚t|j|jƒt ||¡\}}t t |j    |j    ¡¡S)z€
    Array API compatible wrapper for :py:func:`np.subtract <numpy.subtract>`.
 
    See its docstring for more information.
    z+Only numeric dtypes are allowed in subtract)
r rrr    r
rrrÚsubtractrrrrrrQªs
rQcCs$|jtkrtdƒ‚t t |j¡¡S)zv
    Array API compatible wrapper for :py:func:`np.tan <numpy.tan>`.
 
    See its docstring for more information.
    z-Only floating-point dtypes are allowed in tan)r rrr
rrÚtanrrrrrrR¸s
rRcCs$|jtkrtdƒ‚t t |j¡¡S)zx
    Array API compatible wrapper for :py:func:`np.tanh <numpy.tanh>`.
 
    See its docstring for more information.
    z.Only floating-point dtypes are allowed in tanh)r rrr
rrÚtanhrrrrrrSÃs
rScCs2|jtkrtdƒ‚|jtkr |St t |j¡¡S)zz
    Array API compatible wrapper for :py:func:`np.trunc <numpy.trunc>`.
 
    See its docstring for more information.
    z(Only numeric dtypes are allowed in trunc)    r rrrr
rrÚtruncrrrrrrTÎs
 
 
rT)EÚ
__future__rZ_dtypesrrrrrr    Z _array_objectr
Únumpyrrrrrrrrr r!r"r%r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrIrJrKrLrMrNrOrPrQrRrSrTrrrrÚ<module>sv