Skip to content

Commit 176c3e6

Browse files
committed
PERF: change repeat to expand in chunk processing
1 parent 33158ce commit 176c3e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ptychi/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def chunked_processing(
412412
current_chunk_size = kwargs_chunk[list(kwargs_chunk.keys())[0]].shape[0]
413413
if replicated_kwargs is not None:
414414
replicated_kwargs_chunk = {
415-
key: torch.repeat_interleave(value, current_chunk_size, dim=0)
415+
key: value.expand(current_chunk_size, *value.shape[1:])
416416
for key, value in replicated_kwargs.items()
417417
}
418418
kwargs_chunk.update(replicated_kwargs_chunk)

0 commit comments

Comments
 (0)