diff --git a/onnxruntime/core/providers/coreml/model/model.mm b/onnxruntime/core/providers/coreml/model/model.mm index cbee7975b2525..87b438e8c30ee 100644 --- a/onnxruntime/core/providers/coreml/model/model.mm +++ b/onnxruntime/core/providers/coreml/model/model.mm @@ -174,7 +174,7 @@ bool IsArrayContiguous(MLMultiArray* array) { int64_t batch_stride = [array.strides[0] longLongValue]; const auto* shape = array.shape; int64_t batch_elems = 1; - for (int i = 1; i < [shape count]; i++) batch_elems *= [shape[i] longLongValue]; + for (unsigned long i = 1; i < shape.count; i++) batch_elems *= [shape[i] longLongValue]; return batch_stride == batch_elems; } } // namespace @@ -335,7 +335,7 @@ - (Status)predict:(const std::unordered_map&)inputs ORT_RETURN_IF_NOT(IsArrayContiguous(data), "Non-contiguous output MLMultiArray is not currently supported"); __block const void* model_output_buffer = nil; - __block int64_t coreml_buffer_size = 0; + __block unsigned long coreml_buffer_size = 0; [data getBytesWithHandler:^(const void* bytes, NSInteger size) { model_output_buffer = bytes; coreml_buffer_size = size;