Skip to content

Commit

Permalink
Merge pull request #488 from yakir4123/fix/memory-leak-on-deleting-or…
Browse files Browse the repository at this point in the history
…ders

fix(dynamic-numpy-array): extend array only when it less the shape
  • Loading branch information
saleh-mir authored Dec 27, 2024
2 parents a610e77 + 64f6b13 commit 7d08d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jesse/libs/dynamic_numpy_array/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def append_multiple(self, items: np.ndarray) -> None:
def delete(self, index: int, axis=None) -> None:
self.array = np.delete(self.array, index, axis=axis)
self.index -= 1
if self.index == -1:
if self.array.shape[0] <= self.shape[0]:
new_bucket = np.zeros(self.shape)
self.array = np.concatenate((self.array, new_bucket), axis=0)

Expand Down

0 comments on commit 7d08d8d

Please sign in to comment.