You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/website/docs/tutorials/bundled_program.md
+51-64Lines changed: 51 additions & 64 deletions
Original file line number
Diff line number
Diff line change
@@ -76,37 +76,36 @@ To execute the program on the bundled input, we need to load the bundled input i
76
76
```c++
77
77
78
78
/**
79
-
* Compare the execution plan's output with testset_idx-th bundled expected
80
-
* output in plan_idx-th execution plan test.
79
+
* Load testset_idx-th bundled input of method_idx-th Method test in
80
+
* bundled_program_ptr to given Method.
81
81
*
82
-
* @param[in] plan The execution plan contains output.
82
+
* @param[in] method The Method to verify.
83
83
* @param[in] bundled_program_ptr The bundled program contains expected output.
84
-
* @param[in] plan_idx The index of execution plan being verified.
85
-
* @param[in] testset_idx The index of expected output needs to be compared.
86
-
* @param[in] rtol Relative tolerance used for data comparsion.
87
-
* @param[in] atol Absolute tolerance used for data comparsion.
84
+
* @param[in] method_name The name of the Method being verified.
85
+
* @param[in] testset_idx The index of input needs to be set into given Method.
88
86
*
89
-
* @returns Return Error::Ok if two outputs match, or the error happens during
87
+
* @returns Return Error::Ok if load successfully, or the error happens during
90
88
* execution.
91
89
*/
92
90
__ET_NODISCARD Error LoadBundledInput(
93
-
ExecutionPlan& plan,
91
+
Method& method,
94
92
serialized_bundled_program* bundled_program_ptr,
95
-
size_t plan_idx,
93
+
MemoryAllocator* memory_allocator,
94
+
const char* method_name,
96
95
size_t testset_idx);
97
96
```
98
97
99
98
### Verify the plan's output.
100
-
We call `torch::executor::util::VerifyResultWithBundledExpectedOutput` to verify the plan's output with bundled expected outputs. Here's the details of this API:
99
+
We call `torch::executor::util::VerifyResultWithBundledExpectedOutput` to verify the method's output with bundled expected outputs. Here's the details of this API:
101
100
102
101
```c++
103
102
/**
104
-
* Compare the execution plan's output with testset_idx-th bundled expected
105
-
* output in plan_idx-th execution plan test.
103
+
* Compare the Method's output with testset_idx-th bundled expected
104
+
* output in method_idx-th Method test.
106
105
*
107
-
* @param[in] plan The execution plan contains output.
106
+
* @param[in] method The Method to extract outputs from.
108
107
* @param[in] bundled_program_ptr The bundled program contains expected output.
109
-
* @param[in] plan_idx The index of execution plan being verified.
108
+
* @param[in] method_name The name of the Method being verified.
110
109
* @param[in] testset_idx The index of expected output needs to be compared.
111
110
* @param[in] rtol Relative tolerance used for data comparsion.
112
111
* @param[in] atol Absolute tolerance used for data comparsion.
@@ -115,74 +114,62 @@ We call `torch::executor::util::VerifyResultWithBundledExpectedOutput` to verify
Here we provide an example about how to run the bundled program step by step. Most of the code are borrowed from "fbcode/executorch/sdk/runners/executor_runner.cpp":
129
+
Here we provide an example about how to run the bundled program step by step. Most of the code are borrowed from "fbcode/executorch/sdk/runners/executor_runner.cpp" and please review that file if you need more info and context:
0 commit comments