Skip to content

Commit 37c120b

Browse files
Merge pull request #1509 from roboflow/codeflash/optimize-pr1504-2025-08-25T10.24.18
⚡️ Speed up function `construct_simd_step_input` by 37% in PR #1504 (`feature/try-to-beat-the-limitation-of-ee-in-terms-of-singular-elements-pushed-into-batch-inputs`)
2 parents 62460e9 + 2eb0ba3 commit 37c120b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inference/core/workflows/execution_engine/v1/executor/execution_data_manager/step_input_assembler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,9 @@ def prepare_parameters(
431431
parameters={},
432432
)
433433
empty_indices = get_empty_batch_elements_indices(value=result)
434-
indices = [e for e in indices if e not in empty_indices]
435-
result = remove_indices(value=result, indices=empty_indices)
434+
if empty_indices:
435+
indices = [e for e in indices if e not in empty_indices]
436+
result = remove_indices(value=result, indices=empty_indices)
436437
return BatchModeSIMDStepInput(
437438
indices=indices,
438439
parameters=result,

0 commit comments

Comments
 (0)