File tree Expand file tree Collapse file tree 12 files changed +198
-0
lines changed
extension/apple/ExecuTorch Expand file tree Collapse file tree 12 files changed +198
-0
lines changed Original file line number Diff line number Diff line change 66 * LICENSE file in the root directory of this source tree.
77 */
88
9+ #import " ExecuTorchError.h"
910#import " ExecuTorchLog.h"
11+ #import " ExecuTorchModule.h"
12+ #import " ExecuTorchTensor.h"
13+ #import " ExecuTorchValue.h"
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import < Foundation/Foundation.h>
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ FOUNDATION_EXPORT NSErrorDomain const ExecuTorchErrorDomain NS_SWIFT_NAME (ErrorDomain);
14+
15+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import " ExecuTorchError.h"
10+
11+ NSErrorDomain const ExecuTorchErrorDomain = @" org.pytorch.executorch.error" ;
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import " ExecuTorchValue.h"
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ NS_SWIFT_NAME (Module)
14+ __attribute__((deprecated(" This API is experimental." )))
15+ @interface ExecuTorchModule : NSObject
16+
17+ + (instancetype )new NS_UNAVAILABLE;
18+ - (instancetype )init NS_UNAVAILABLE;
19+
20+ @end
21+
22+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import " ExecuTorchModule.h"
10+
11+ #import " ExecuTorchError.h"
12+
13+ #import < executorch/extension/module/module.h>
14+ #import < executorch/extension/tensor/tensor.h>
15+
16+ @implementation ExecuTorchModule {
17+ std::unique_ptr<executorch::extension::Module> _module;
18+ }
19+
20+ @end
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import < Foundation/Foundation.h>
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ NS_SWIFT_NAME (Tensor)
14+ __attribute__((deprecated(" This API is experimental." )))
15+ @interface ExecuTorchTensor : NSObject
16+
17+ + (instancetype )new NS_UNAVAILABLE;
18+ - (instancetype )init NS_UNAVAILABLE;
19+
20+ @end
21+
22+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import " ExecuTorchTensor.h"
10+
11+ #import " ExecuTorchError.h"
12+
13+ #import < executorch/extension/tensor/tensor.h>
14+
15+ @implementation ExecuTorchTensor {
16+ ::executorch::extension::TensorPtr _tensor;
17+ }
18+
19+ @end
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import " ExecuTorchTensor.h"
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ NS_SWIFT_NAME (Value)
14+ __attribute__((deprecated(" This API is experimental." )))
15+ @interface ExecuTorchValue : NSObject
16+
17+ @end
18+
19+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ #import " ExecuTorchValue.h"
10+
11+ @implementation ExecuTorchValue
12+
13+ @end
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ * All rights reserved.
4+ *
5+ * This source code is licensed under the BSD-style license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ @testable import ExecuTorch
10+
11+ import XCTest
12+
13+ class ModuleTest : XCTestCase {
14+ func test( ) throws {
15+ let bundle = Bundle ( for: type ( of: self ) )
16+ guard let modelPath = bundle. path ( forResource: " add " , ofType: " pte " ) else {
17+ XCTFail ( " Couldn't find the model file " )
18+ return
19+ }
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments