Commit 12047d2
authored
Support numpy scalars in
Numpy scalars (https://numpy.org/doc/2.2/reference/arrays.scalars.html)
have `__array__` defined but doesn't behave like normal np arrays
sometimes. This change updates the initialization logic in `Tensor` to
detect them and turn them into np.ndarray.
Fixes #101.
---------
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>Tensor (#102)1 parent 92fc9d7 commit 12047d2
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
420 | 423 | | |
421 | 424 | | |
422 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
| |||
0 commit comments