Skip to content

Commit 5531caf

Browse files
authored
Re-introduce the type-erasing tensor class.
Differential Revision: D76908591 Pull Request resolved: #11790
1 parent 3c05b6c commit 5531caf

File tree

5 files changed

+689
-198
lines changed

5 files changed

+689
-198
lines changed

extension/apple/ExecuTorch/Exported/ExecuTorch+Module.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public extension Module {
6060
/// - Returns: An array of `Value` objects representing the outputs.
6161
/// - Throws: An error if method execution fails.
6262
func execute(_ method: String, _ inputs: [ValueConvertible]) throws -> [Value] {
63-
try __executeMethod(method, withInputs: inputs.map { $0.objcValue() } )
63+
try __executeMethod(method, withInputs: inputs.map { $0.asValue() } )
6464
}
6565

6666
/// Executes a specific method with a single input value.
@@ -72,7 +72,7 @@ public extension Module {
7272
/// - Returns: An array of `Value` objects representing the outputs.
7373
/// - Throws: An error if method execution fails.
7474
func execute(_ method: String, _ input: ValueConvertible) throws -> [Value] {
75-
try __executeMethod(method, withInputs: [input.objcValue()])
75+
try __executeMethod(method, withInputs: [input.asValue()])
7676
}
7777

7878
/// Executes the "forward" method with the provided input values.
@@ -82,7 +82,7 @@ public extension Module {
8282
/// - Returns: An array of `Value` objects representing the outputs.
8383
/// - Throws: An error if method execution fails.
8484
func forward(_ inputs: [ValueConvertible]) throws -> [Value] {
85-
try __executeMethod("forward", withInputs: inputs.map { $0.objcValue() })
85+
try __executeMethod("forward", withInputs: inputs.map { $0.asValue() })
8686
}
8787

8888
/// Executes the "forward" method with a single input value.
@@ -92,6 +92,6 @@ public extension Module {
9292
/// - Returns: An array of `Value` objects representing the outputs.
9393
/// - Throws: An error if method execution fails.
9494
func forward(_ input: ValueConvertible) throws -> [Value] {
95-
try __executeMethod("forward", withInputs: [input.objcValue()])
95+
try __executeMethod("forward", withInputs: [input.asValue()])
9696
}
9797
}

0 commit comments

Comments
 (0)