Skip to content

Commit 1e574e8

Browse files
authored
Fix ETCoreMLModelManager tests
1 parent cda554c commit 1e574e8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

backends/apple/coreml/runtime/test/ETCoreMLModelManagerTests.mm

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#import <XCTest/XCTest.h>
1616
#import <executorch/runtime/platform/runtime.h>
1717
#import <model_logging_options.h>
18+
#import <multiarray.h>
19+
20+
using namespace executorchcoreml;
1821

1922
@interface ETCoreMLModelManagerTests : XCTestCase
2023

@@ -94,7 +97,7 @@ - (void)testModelPrewarm {
9497
- (void)testAddModelExecution {
9598
NSURL *modelURL = [[self class] bundledResourceWithName:@"add_coreml_all" extension:@"bin"];
9699
XCTAssertNotNil(modelURL);
97-
100+
98101
NSError *localError = nil;
99102
NSData *data = [NSData dataWithContentsOfURL:modelURL];
100103
MLModelConfiguration *configuration = [[MLModelConfiguration alloc] init];
@@ -105,12 +108,12 @@ - (void)testAddModelExecution {
105108
int y = 50;
106109
// add_coreml_all does the following operation.
107110
int z = x + y;
108-
111+
109112
NSArray<MLMultiArray *> *inputs = [ETCoreMLTestUtils inputsForModel:model repeatedValues:@[@(x), @(y)] error:&localError];
110113
XCTAssertNotNil(inputs);
111114
MLMultiArray *output = [ETCoreMLTestUtils filledMultiArrayWithShape:inputs[0].shape dataType:inputs[0].dataType repeatedValue:@(0) error:&localError];
112115
NSArray<MLMultiArray *> *args = [inputs arrayByAddingObject:output];
113-
XCTAssertTrue([self.modelManager executeModelWithHandle:handle
116+
XCTAssertTrue([self.modelManager executeModelWithHandle:handle
114117
args:args
115118
loggingOptions:executorchcoreml::ModelLoggingOptions()
116119
eventLogger:nullptr
@@ -124,7 +127,7 @@ - (void)testAddModelExecution {
124127
- (void)testMulModelExecution {
125128
NSURL *modelURL = [[self class] bundledResourceWithName:@"mul_coreml_all" extension:@"bin"];
126129
XCTAssertNotNil(modelURL);
127-
130+
128131
NSError *localError = nil;
129132
NSData *data = [NSData dataWithContentsOfURL:modelURL];
130133
MLModelConfiguration *configuration = [[MLModelConfiguration alloc] init];
@@ -148,7 +151,6 @@ - (void)testMulModelExecution {
148151
}
149152
}
150153

151-
// See https://github.com/pytorch/executorch/pull/10465
152154
- (void)testAutoreleasepoolError {
153155
NSURL *modelURL = [self.class bundledResourceWithName:@"add_coreml_all" extension:@"bin"];
154156
NSError *localError = nil;

0 commit comments

Comments
 (0)