Skip to content

Commit

Permalink
Joined subsequent for loops to avoid keeping faces in memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-albert committed Oct 19, 2023
1 parent 56ac712 commit 43efb6a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dask_image/ndmeasure/_utils/_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,9 @@ def label_adjacency_graph(labels, structure, nlabels, wrap_axes=None):
labels.chunks, labels.shape, structure, wrap_axes=wrap_axes
)
all_mappings = [da.empty((2, 0), dtype=LABEL_DTYPE, chunks=1)]
faces = []

for face_slice in face_slices:
faces.append(labels[face_slice])

for face in faces:
face = labels[face_slice]
mapped = _across_block_label_grouping_delayed(face, structure)
all_mappings.append(mapped)

Expand Down

0 comments on commit 43efb6a

Please sign in to comment.