Skip to content

Commit 78591f9

Browse files
Revert "Introduce set input/output API to Module. (#13363)"
This reverts commit 70ab5ab.
1 parent 9cfb684 commit 78591f9

File tree

4 files changed

+0
-423
lines changed

4 files changed

+0
-423
lines changed

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

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -176,123 +176,3 @@ public extension Module {
176176
try execute("forward")
177177
}
178178
}
179-
180-
@available(*, deprecated, message: "This API is experimental.")
181-
public extension Module {
182-
/// Sets a single input value for a method at the specified index.
183-
///
184-
/// - Parameters:
185-
/// - value: The input as a `ValueConvertible`.
186-
/// - method: The method name.
187-
/// - index: Zero-based input index.
188-
/// - Throws: If setting the input fails.
189-
func setInput(_ value: ValueConvertible, for method: String, at index: Int) throws {
190-
try __setInput(value.asValue(), forMethod: method, at: index)
191-
}
192-
193-
/// Sets a single input value for a method at index 0.
194-
///
195-
/// - Parameters:
196-
/// - value: The input as a `ValueConvertible`.
197-
/// - method: The method name.
198-
/// - Throws: If setting the input fails.
199-
func setInput(_ value: ValueConvertible, for method: String) throws {
200-
try setInput(value, for: method, at: 0)
201-
}
202-
203-
/// Sets a single input value for the "forward" method at the specified index.
204-
///
205-
/// - Parameters:
206-
/// - value: The input as a `ValueConvertible`.
207-
/// - index: Zero-based input index.
208-
/// - Throws: If setting the input fails.
209-
func setInput(_ value: ValueConvertible, at index: Int) throws {
210-
try setInput(value, for: "forward", at: index)
211-
}
212-
213-
/// Sets the first input value (index 0) for the "forward" method.
214-
///
215-
/// - Parameter value: The input as a `ValueConvertible`.
216-
/// - Throws: If setting the input fails.
217-
func setInput(_ value: ValueConvertible) throws {
218-
try setInput(value, for: "forward", at: 0)
219-
}
220-
221-
/// Sets all input values for a method.
222-
///
223-
/// - Parameters:
224-
/// - values: The inputs as an array of `ValueConvertible`.
225-
/// - method: The method name.
226-
/// - Throws: If setting the inputs fails.
227-
func setInputs(_ values: [ValueConvertible], for method: String) throws {
228-
try __setInputs(values.map { $0.asValue() }, forMethod: method)
229-
}
230-
231-
/// Sets all input values for the "forward" method.
232-
///
233-
/// - Parameter values: The inputs as an array of `ValueConvertible`.
234-
/// - Throws: If setting the inputs fails.
235-
func setInputs(_ values: [ValueConvertible]) throws {
236-
try setInputs(values, for: "forward")
237-
}
238-
239-
/// Sets all input values for a method using variadic arguments.
240-
///
241-
/// - Parameters:
242-
/// - values: The inputs as a variadic list of `ValueConvertible`.
243-
/// - method: The method name.
244-
/// - Throws: If setting the inputs fails.
245-
func setInputs(_ values: ValueConvertible..., for method: String) throws {
246-
try setInputs(values, for: method)
247-
}
248-
249-
/// Sets all input values for the "forward" method using variadic arguments.
250-
///
251-
/// - Parameter values: The inputs as a variadic list of `ValueConvertible`.
252-
/// - Throws: If setting the inputs fails.
253-
func setInputs(_ values: ValueConvertible...) throws {
254-
try setInputs(values, for: "forward")
255-
}
256-
257-
/// Sets the output location for a method at the specified index.
258-
///
259-
/// Only tensor outputs are supported. The provided value must wrap a tensor
260-
/// with compatible shape and data type for the method’s output slot.
261-
///
262-
/// - Parameters:
263-
/// - value: The output buffer as a `ValueConvertible` (tensor).
264-
/// - method: The method name.
265-
/// - index: Zero-based output index.
266-
/// - Throws: If setting the output fails.
267-
func setOutput(_ value: ValueConvertible, for method: String, at index: Int) throws {
268-
try __setOutput(value.asValue(), forMethod: method, at: index)
269-
}
270-
271-
/// Sets the output location for a method at index 0.
272-
///
273-
/// - Parameters:
274-
/// - value: The output buffer as a `ValueConvertible` (tensor).
275-
/// - method: The method name.
276-
/// - Throws: If setting the output fails.
277-
func setOutput(_ value: ValueConvertible, for method: String) throws {
278-
try setOutput(value, for: method, at: 0)
279-
}
280-
281-
/// Sets the output location for the "forward" method at the specified index.
282-
///
283-
/// - Parameters:
284-
/// - value: The output buffer as a `ValueConvertible` (tensor).
285-
/// - index: Zero-based output index.
286-
/// - Throws: If setting the output fails.
287-
func setOutput(_ value: ValueConvertible, at index: Int) throws {
288-
try setOutput(value, for: "forward", at: index)
289-
}
290-
291-
/// Sets the first output location (index 0) for the "forward" method.
292-
///
293-
/// - Parameter value: The output buffer as a `ValueConvertible` (tensor).
294-
/// - Throws: If setting the output fails.
295-
func setOutput(_ value: ValueConvertible) throws {
296-
try setOutput(value, for: "forward", at: 0)
297-
}
298-
}

extension/apple/ExecuTorch/Exported/ExecuTorchModule.h

Lines changed: 0 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -366,145 +366,6 @@ __attribute__((deprecated("This API is experimental.")))
366366
NS_SWIFT_UNAVAILABLE("")
367367
NS_RETURNS_RETAINED;
368368

369-
/**
370-
* Sets a single input value for the "forward" method at index 0.
371-
*
372-
* @param value The input value.
373-
* @param error On failure, set to an NSError describing the issue.
374-
* @return YES on success; NO otherwise.
375-
*/
376-
- (BOOL)setInput:(ExecuTorchValue *)value
377-
error:(NSError **)error NS_SWIFT_UNAVAILABLE("");
378-
379-
/**
380-
* Sets a single input value for the "forward" method at the specified index.
381-
*
382-
* @param value The input value.
383-
* @param index Zero-based input index.
384-
* @param error On failure, set to an NSError describing the issue.
385-
* @return YES on success; NO otherwise.
386-
*/
387-
- (BOOL)setInput:(ExecuTorchValue *)value
388-
atIndex:(NSInteger)index
389-
error:(NSError **)error NS_SWIFT_UNAVAILABLE("");
390-
391-
/**
392-
* Sets a single input value for the specified method at index 0.
393-
*
394-
* @param value The input value.
395-
* @param methodName The method name.
396-
* @param error On failure, set to an NSError describing the issue.
397-
* @return YES on success; NO otherwise.
398-
*/
399-
- (BOOL)setInput:(ExecuTorchValue *)value
400-
forMethod:(NSString *)methodName
401-
error:(NSError **)error NS_SWIFT_UNAVAILABLE("");
402-
403-
/**
404-
* Sets a single input value for the specified method at the given index.
405-
*
406-
* The module retains the provided value to keep its backing storage alive
407-
* until the value is overwritten or the module is deallocated.
408-
*
409-
* @param value The input value.
410-
* @param methodName The method name.
411-
* @param index Zero-based input index.
412-
* @param error On failure, set to an NSError describing the issue.
413-
* @return YES on success; NO otherwise.
414-
*/
415-
- (BOOL)setInput:(ExecuTorchValue *)value
416-
forMethod:(NSString *)methodName
417-
atIndex:(NSInteger)index
418-
error:(NSError **)error NS_REFINED_FOR_SWIFT;
419-
420-
/**
421-
* Sets all input values for the "forward" method.
422-
*
423-
* The number and types of values must match the method’s declared inputs.
424-
*
425-
* @param values The input values, one per declared input.
426-
* @param error On failure, set to an NSError describing the issue.
427-
* @return YES on success; NO otherwise.
428-
*/
429-
- (BOOL)setInputs:(NSArray<ExecuTorchValue *> *)values
430-
error:(NSError **)error NS_SWIFT_UNAVAILABLE("");
431-
432-
/**
433-
* Sets all input values for the specified method.
434-
*
435-
* The module retains the provided values to keep their backing storage alive
436-
* until the values are overwritten or the module is deallocated.
437-
*
438-
* @param values The input values, one per declared input.
439-
* @param methodName The method name.
440-
* @param error On failure, set to an NSError describing the issue.
441-
* @return YES on success; NO otherwise.
442-
*/
443-
- (BOOL)setInputs:(NSArray<ExecuTorchValue *> *)values
444-
forMethod:(NSString *)methodName
445-
error:(NSError **)error NS_REFINED_FOR_SWIFT;
446-
447-
/**
448-
* Sets the output buffer for the "forward" method at index 0.
449-
*
450-
* Only tensor outputs are supported. The provided value must wrap a tensor
451-
* compatible with the method’s output slot.
452-
*
453-
* @param value The output buffer (must wrap a tensor).
454-
* @param error On failure, set to an NSError describing the issue.
455-
* @return YES on success; NO otherwise.
456-
*/
457-
- (BOOL)setOutput:(ExecuTorchValue *)value
458-
error:(NSError **)error NS_SWIFT_UNAVAILABLE("");
459-
460-
/**
461-
* Sets the output buffer for the "forward" method at the specified index.
462-
*
463-
* Only tensor outputs are supported. The provided value must wrap a tensor
464-
* compatible with the method’s output slot.
465-
*
466-
* @param value The output buffer (must wrap a tensor).
467-
* @param index Zero-based output index.
468-
* @param error On failure, set to an NSError describing the issue.
469-
* @return YES on success; NO otherwise.
470-
*/
471-
- (BOOL)setOutput:(ExecuTorchValue *)value
472-
atIndex:(NSInteger)index
473-
error:(NSError **)error NS_SWIFT_UNAVAILABLE("");
474-
475-
/**
476-
* Sets the output buffer for the specified method at index 0.
477-
*
478-
* Only tensor outputs are supported. The provided value must wrap a tensor
479-
* compatible with the method’s output slot.
480-
*
481-
* @param value The output buffer (must wrap a tensor).
482-
* @param methodName The method name.
483-
* @param error On failure, set to an NSError describing the issue.
484-
* @return YES on success; NO otherwise.
485-
*/
486-
- (BOOL)setOutput:(ExecuTorchValue *)value
487-
forMethod:(NSString *)methodName
488-
error:(NSError **)error NS_SWIFT_UNAVAILABLE("");
489-
490-
/**
491-
* Sets the output buffer for the specified method at the given index.
492-
*
493-
* The module retains the provided value to keep its backing storage alive
494-
* until the value is overwritten or the module is deallocated.
495-
* Only tensor outputs are supported.
496-
*
497-
* @param value The output buffer (must wrap a tensor).
498-
* @param methodName The method name.
499-
* @param index Zero-based output index.
500-
* @param error On failure, set to an NSError describing the issue.
501-
* @return YES on success; NO otherwise.
502-
*/
503-
- (BOOL)setOutput:(ExecuTorchValue *)value
504-
forMethod:(NSString *)methodName
505-
atIndex:(NSInteger)index
506-
error:(NSError **)error NS_REFINED_FOR_SWIFT;
507-
508369
+ (instancetype)new NS_UNAVAILABLE;
509370
- (instancetype)init NS_UNAVAILABLE;
510371

0 commit comments

Comments
 (0)