Skip to content

Commit 65171cc

Browse files
committed
up
1 parent f022977 commit 65171cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

backends/apple/coreml/runtime/delegate/coreml_backend_delegate.mm

+6
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ ModelLoggingOptions get_logging_options(BackendExecutionContext& context) {
241241
std::array<SizesType, kTensorDimensionLimit> new_shape;
242242
for (size_t i = nInputs; i < nInputs + nOutputs; i++) {
243243
Tensor& t = args[i]->toTensor();
244+
// If t has rank 0, do not resize. delegate_args[i] will have rank 1
245+
// because we resized it in get_multi_array
246+
if (t.dim() == 0) {
247+
continue;
248+
}
249+
244250
int rank = delegate_args[i].layout().rank();
245251
assert (rank <= new_shape.size());
246252
for (int d = 0; d < rank; d++) {

0 commit comments

Comments
 (0)