Commit 91a53bc
Adding __array_function__ so that Numpy calls with dparrays work. (#261)
* Calling numpy.sum with a dparray should work now. __array_function__ is now implemented. I changed the way that we determine if a class or function is defined in this file from using eval to getting the module from sys.modules[__name__] and then using hasattr on the module.
* Efficiency improvements
1. Create class_list, function_list in one pass over members of np module
2. Renamed isdef into _isdef, since it is an internal function
3. Create certain objects in __array_function__ only if we intend to use
them.
* Darkened numpy_with_usm_shared.py with black
* account of C-API defined functions of NumPy
* Don't need atypes since that just verified it was the same as the types argument. Don't need fatypes since it wasn't being used.
* black changes
* Don't need explicit if debug once we get rid of atypes calculation. That allows dprint to move left and back to one line.
Co-authored-by: Oleksandr Pavlyk <oleksandr.pavlyk@intel.com>1 parent 609c8fd commit 91a53bc
2 files changed
+31
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
93 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| |||
224 | 234 | | |
225 | 235 | | |
226 | 236 | | |
227 | | - | |
| 237 | + | |
228 | 238 | | |
229 | 239 | | |
230 | 240 | | |
| |||
277 | 287 | | |
278 | 288 | | |
279 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
280 | 300 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
287 | 305 | | |
288 | 306 | | |
289 | 307 | | |
290 | 308 | | |
291 | | - | |
| 309 | + | |
292 | 310 | | |
293 | 311 | | |
294 | 312 | | |
| |||
305 | 323 | | |
306 | 324 | | |
307 | 325 | | |
308 | | - | |
| 326 | + | |
309 | 327 | | |
310 | 328 | | |
311 | 329 | | |
| |||
321 | 339 | | |
322 | 340 | | |
323 | 341 | | |
324 | | - | |
| 342 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
0 commit comments