Skip to content

Commit

Permalink
Don't try to free static array in mnist example (#3049)
Browse files Browse the repository at this point in the history
I don't think its correct to free a static array, it was causing ABORTS with `free(): invalid pointer` printed for me.

Signed-off-by: Zentrik <[email protected]>
Co-authored-by: Alexandre Eichenberger <[email protected]>
Co-authored-by: Tung D. Le <[email protected]>
  • Loading branch information
3 people authored Feb 14, 2025
1 parent df601dc commit be4a2b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/mnist_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ int main() {
// When the parameter, owning is set to "true", the OMTensor will free the data
// pointer (img_data) upon destruction. If owning is set to false, the data pointer will
// not be freed upon destruction.
OMTensor *tensor = omTensorCreateWithOwnership(img_data, shape, rank, ONNX_TYPE_FLOAT, /*owning=*/true);
OMTensor *tensor = omTensorCreateWithOwnership(img_data, shape, rank, ONNX_TYPE_FLOAT, /*owning=*/false);
// Create a tensor list using omTensorListCreate (returns a pointer to the OMTensorList).
inputTensors[0] = tensor;
Expand Down

0 comments on commit be4a2b8

Please sign in to comment.