-
Notifications
You must be signed in to change notification settings - Fork 537
Swift and/or Objective-C Bindings #8263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@GregoryComer - we do have such bindings as documented here: https://pytorch.org/executorch/stable/apple-runtime.html What are the actual gaps? cc @shoumikhin |
@mergennachin I guess @GregoryComer means bindings beyond logging. As explained in the doc, we currently support only logging APis in ObjC/Swift, and what we want eventually is such native bindings for let module = Module(filePath: "/path/to/add.pte")
let inputs = [Tensor([2]), Tensor([3])]
let outputs = try module.forward(inputs)
XCTAssertEqual(outputs[0].tensor, Tensor([5])) |
@shoumikhin Sounds great. native Swift APIs I think would be very nice. Some internal teams have asked for this, which was the motivation for this feature request. I think it will help reduce onboarding friction for iOS devs since it seems like many devs don't want to touch C++. |
I've just started #8360 umbrella issue to cover this work-stream and provide more details. |
Closing in lieu of #8360 |
🚀 The feature, motivation and pitch
From experience working with internal teams, many mobile developers prefer working with higher-level languages, when possible. It would likely benefit the user experience if we can provide Swift and/or Objective-C bindings as part of framework, likely under the Apple extension. I don't have a ton of context on developer ergonomics of calling the native C++ APIs from Swift or Objective-C, so I'll defer to the experts on this (@shoumikhin). However, given that it has been requested a few times, I think it's worth evaluating having official bindings for Swift, at least.
Alternatives
No response
Additional context
No response
RFC (Optional)
No response
cc @shoumikhin @mergennachin @byjlw
The text was updated successfully, but these errors were encountered: