Skip to content

Commit e30a7c1

Browse files
committed
Fix uninitialised _outputNames in ETCoreMLModelProfiler
The _outputNames property was not initialised in initWithModel:configuration:error:, causing set_model_outputs() to produce an empty array when debug_buffer_size=0. This led to an NSRangeException (index 0 beyond bounds for empty array) in ETCoreMLModelManager when accessing modelOutputs[0].shape for dynamic shape resizing. When debug_buffer_size > 0, the bug was masked because the debugging path (debugModelWithInputs) overwrote the empty profiling output with valid results.
1 parent 4afd7f9 commit e30a7c1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

backends/apple/coreml/runtime/sdk/ETCoreMLModelProfiler.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ - (nullable instancetype)initWithModel:(ETCoreMLModel *)model
276276
self = [super init];
277277
if (self) {
278278
_model = model;
279+
_outputNames = model.orderedOutputNames;
279280
_computePlan = computePlan;
280281
_operationToPathMap = operationToPathMap;
281282
_topologicallySortedOperations = topologicallySortedOperations;

0 commit comments

Comments
 (0)