Skip to content

Commit

Permalink
fix: drop itemsize
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Nov 1, 2023
1 parent 36954f1 commit 511d055
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/awkward/_nplikes/array_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def broadcast_to(self, x: ArrayLike, shape: tuple[ShapeItem, ...]) -> ArrayLike:
def strides(self, x: ArrayLike) -> tuple[ShapeItem, ...]:
if isinstance(x, PlaceholderArray):
# Assume contiguous
strides: tuple[ShapeItem, ...] = (x.itemsize,)
strides: tuple[ShapeItem, ...] = (x.dtype.itemsize,)
for item in x.shape[-1:0:-1]:
strides = (item * strides[0], *strides)
return strides
Expand Down
5 changes: 0 additions & 5 deletions src/awkward/_nplikes/numpylike.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ def dtype(self) -> numpy.dtype:
def ndim(self) -> int:
...

@property
@abstractmethod
def itemsize(self) -> int:
...

@property
@abstractmethod
def shape(self) -> tuple[ShapeItem, ...]:
Expand Down
4 changes: 0 additions & 4 deletions src/awkward/_nplikes/placeholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ def size(self) -> ShapeItem:
def nbytes(self) -> int:
return 0

@property
def itemsize(self) -> int:
return self._dtype.itemsize

@property
def strides(self) -> tuple[ShapeItem, ...]:
out: tuple[ShapeItem, ...] = (self._dtype.itemsize,)
Expand Down

0 comments on commit 511d055

Please sign in to comment.