mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-01-01 03:28:57 +01:00
coreml : fix memory leak (#899)
This commit is contained in:
parent
bf2449dfae
commit
1d17cd5bb3
@ -51,15 +51,10 @@ void whisper_coreml_encode(
|
|||||||
|
|
||||||
whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
|
whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
|
||||||
|
|
||||||
MLMultiArray * outMA = outCoreML.output;
|
memcpy(out, outCoreML.output.dataPointer, outCoreML.output.count * sizeof(float));
|
||||||
|
|
||||||
//NSArray<NSNumber *> * shape = outMA.shape;
|
[outCoreML release];
|
||||||
//NSArray<NSNumber *> * strides = outMA.strides;
|
[inMultiArray release];
|
||||||
|
|
||||||
//printf("shape: %ld %ld %ld %ld\n", [shape[0] longValue], [shape[1] longValue], [shape[2] longValue], [shape[3] longValue]);
|
|
||||||
//printf("strides: %ld %ld %ld %ld\n", [strides[0] longValue], [strides[1] longValue], [strides[2] longValue], [strides[3] longValue]);
|
|
||||||
|
|
||||||
memcpy(out, outMA.dataPointer, outMA.count * sizeof(float));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
|
Loading…
Reference in New Issue
Block a user