forked from M-Labs/nac3
1
0
Fork 0
Commit Graph

21 Commits

Author SHA1 Message Date
lyken 787fe23202
fixup! core/ndstrides: implement ndarray indexing
fix index comment
2024-08-23 11:50:45 +08:00
lyken 122f55e615
core/object: add RangeObject & RangeObject::len 2024-08-23 10:22:01 +08:00
lyken 5c68ef00ac
core/irrt: refactor out slice::indices and range::len 2024-08-23 10:02:45 +08:00
lyken 3782791323
core: make IRRT slice and range work for any int types 2024-08-23 09:52:08 +08:00
lyken be4b04dbb3
core: remove old ndarray code and NDArray proxy
Nothing depends on the old ndarray implementation now.
2024-08-22 16:34:27 +08:00
lyken 4fef633090
core/ndstrides: implement general ndarray matmul 2024-08-22 16:23:01 +08:00
lyken e8e4801c92
core/ndstrides: implement np_transpose() (no axes argument) 2024-08-22 16:23:01 +08:00
lyken 9bdc520bbc
core/ndstrides: implement broadcasting & np_broadcast_to() 2024-08-22 16:23:01 +08:00
lyken 9bd08f8de8
core/ndstrides: implement np_reshape() 2024-08-22 16:23:01 +08:00
lyken ada6e95d75
core/ndstrides: implement np_array()
It also checks for inconsistent dimensions if the input is a list.
e.g., rejecting `[[1.0, 2.0], [3.0]]`. Previously it was a todo of
`np_array()`.
2024-08-22 16:23:01 +08:00
lyken 4dcbaed8ee
core/irrt: add List
Needed for implementing np_array()
2024-08-22 16:23:01 +08:00
lyken 0a874da5fc
core/ndstrides: implement ndarray indexing
The functionality for `...` and `np.newaxis` is there in IRRT, but there
is no implementation of them for @kernel Python expressions because of
M-Labs/nac3#486.
2024-08-22 16:23:01 +08:00
lyken c74b1eb9d8
core/irrt: rename NDIndex to NDIndexInt
The name `NDIndex` is used in later commits.
2024-08-22 16:23:01 +08:00
lyken bda003989e
core/irrt: add Slice and Range
Needed for implementing general ndarray indexing
2024-08-22 16:23:01 +08:00
lyken 48fb3ff5ad
core/ndstrides: add ndarray iterator (NDIter) 2024-08-22 16:23:00 +08:00
lyken 4777909543
core/ndstrides: define ndarray with strides 2024-08-22 16:23:00 +08:00
lyken 1c7ce22fd5
core/irrt/exceptions: add debug utils with exceptions 2024-08-22 10:06:45 +08:00
lyken 9d3d552e93
core/irrt/exceptions: allow irrt to raise exceptions 2024-08-22 10:06:45 +08:00
lyken d6deb5af26
core/irrt: split irrt.cpp into headers 2024-08-22 10:06:45 +08:00
lyken ecd72e8cad
core/irrt: reformat 2024-08-22 10:06:45 +08:00
lyken 3c4d04e7c9
core/irrt: comment build.rs & move irrt to its own dir
To prepare for future IRRT implementations, and to also make cargo
only have to watch a single directory.
2024-08-22 10:06:45 +08:00