Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0b72704
Allow : and ... on singleton array slices
manopapad May 7, 2021
8435dbe
Typos
manopapad May 7, 2021
ff8598a
Add column zipping tasks
manopapad May 13, 2021
2837432
Typo
manopapad May 13, 2021
74a4231
Add some slicing tests
manopapad May 14, 2021
2e68950
Cast index arrays to int64
manopapad May 14, 2021
9c2a632
Ensure all partitions in indirect copies use the same color space
manopapad May 14, 2021
53acab8
Remove some unsupported behavior from testcase
manopapad May 14, 2021
184a49a
Comment out some more unsupported tests
manopapad May 14, 2021
7d1ad38
Uncommited files
manopapad May 27, 2021
90f2b9b
self.scalar is equivalent to self.size == 1
manopapad May 27, 2021
332aa77
Fix handling of basic slicing over singleton arrays
manopapad May 27, 2021
3cadcfc
Combine N index arrays into one Point<N> array
manopapad Jun 1, 2021
7824325
Merge branch 'master' into slicing
manopapad Jun 3, 2021
f32de13
Reenable some tests that should pass
manopapad Jun 3, 2021
7a7ab88
Merge branch 'master' into slicing
manopapad Jun 3, 2021
02d780b
Disable unsupported tests
manopapad Jun 5, 2021
23153a1
Generalize ND_1D projection functor to ND_MD
manopapad Jun 9, 2021
ebf39b5
Add support for simple cases of indirect partitioning
manopapad Jun 9, 2021
3dba490
Merge branch 'master' into slicing
manopapad Jun 22, 2021
8dd465f
Merge branch 'master' into slicing
manopapad Jun 23, 2021
14c76e7
Typos & minor changes
manopapad Jun 29, 2021
3e73211
Implement dense path for some more operations
manopapad Jun 29, 2021
5922260
Use signed ints for index arrays
manopapad Jun 29, 2021
a662800
Support most cases of views with advanced indexing
manopapad Jun 29, 2021
d9fa0b9
Merge branch 'master' into slicing
manopapad Jul 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions legate/numpy/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,6 @@ def _convert_key(self, key, stacklevel=2, first=True):
def __getitem__(self, key):
if key is None:
raise KeyError("invalid key passed to legate.numpy.ndarray")
# If we're a scalar, we're our own value
if self.size == 1:
if (self.ndim == 0 and key != () and key != Ellipsis) or (
key != ((0,) * self.ndim)
):
raise KeyError("invalid key passed to legate.numpy.ndarray")
return self
key = self._convert_key(key)
return ndarray(
shape=None, thunk=self._thunk.get_item(key, stacklevel=2)
Expand Down Expand Up @@ -745,11 +738,6 @@ def __setitem__(self, key, value):
temp = ndarray(value_array.shape, dtype=self.dtype)
temp._thunk.convert(value_array._thunk, stacklevel=2)
value_array = temp
if self.size == 1:
if (self.ndim == 0 and key != () and key != Ellipsis) or (
key != ((0,) * self.ndim)
):
raise KeyError("invalid key passed to legate.numpy.ndarray")
key = self._convert_key(key)
self._thunk.set_item(key, value_array._thunk, stacklevel=2)

Expand Down
4 changes: 3 additions & 1 deletion legate/numpy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ class NumPyOpCode(IntEnum):
INCLUSIVE_SCAN = legate_numpy.NUMPY_INCLUSIVE_SCAN
CONVERT_TO_RECT = legate_numpy.NUMPY_CONVERT_TO_RECT
ARANGE = legate_numpy.NUMPY_ARANGE
ZIP = legate_numpy.NUMPY_ZIP
TRANSFORM = legate_numpy.NUMPY_TRANSFORM


# Match these to NumPyRedopID in legate_numpy_c.h
Expand Down Expand Up @@ -317,6 +319,6 @@ class NumPyProjCode(IntEnum):
PROJ_RADIX_3D_Z_4_2 = legate_numpy.NUMPY_PROJ_RADIX_3D_Z_4_2
PROJ_RADIX_3D_Z_4_3 = legate_numpy.NUMPY_PROJ_RADIX_3D_Z_4_3
# Flattening
PROJ_ND_1D_C_ORDER = legate_numpy.NUMPY_PROJ_ND_1D_C_ORDER
PROJ_ND_MD_C_ORDER = legate_numpy.NUMPY_PROJ_ND_MD_C_ORDER
# Must always be last
PROJ_LAST = legate_numpy.NUMPY_PROJ_LAST
Loading