@@ -498,6 +498,41 @@ class Module {
498
498
return set_output (" forward" , std::move (output_value), output_index);
499
499
}
500
500
501
+ /* *
502
+ * Sets all output tensors for a specific method.
503
+ *
504
+ * Loads the program and method if needed, and for each output uses
505
+ * the provided tensor's data buffer as the method's output buffer.
506
+ *
507
+ * @param[in] method_name The name of the method.
508
+ * @param[in] output_values A vector of EValues to set as the method outputs.
509
+ *
510
+ * @returns An Error to indicate success or failure.
511
+ *
512
+ * @note Only Tensor outputs are currently supported for setting.
513
+ * @note Will fail for outputs that are memory-planned or constants.
514
+ */
515
+ ET_NODISCARD
516
+ runtime::Error set_outputs (
517
+ const std::string& method_name,
518
+ const std::vector<runtime::EValue>& output_values);
519
+
520
+ /* *
521
+ * Sets all output tensors for the "forward" method.
522
+ *
523
+ * @param[in] output_values A vector of EValues to set as the method outputs.
524
+ *
525
+ * @returns An Error to indicate success or failure.
526
+ *
527
+ * @note Only Tensor outputs are currently supported for setting.
528
+ * @note Will fail for outputs that are memory-planned or constants.
529
+ */
530
+ ET_NODISCARD
531
+ inline runtime::Error set_outputs (
532
+ const std::vector<runtime::EValue>& output_values) {
533
+ return set_outputs (" forward" , output_values);
534
+ }
535
+
501
536
/* *
502
537
* Retrieves the EventTracer instance being used by the Module.
503
538
* EventTracer is used for tracking and logging events during the execution
0 commit comments