Skip to content

Commit 053d845

Browse files
Update on "[ExecuTorch][#10375] Add extension.BundledModule to Wrap extension.Module with Bundled Program Logic"
#10375 # Context This issue is a step of #9638. In #9638, we want to have `extension.Module` as the single source of implementation in `pybindings`, which means that `pybindings.PyModule` should use `extension.Module` rather than its own `pybindings.Module`. The issue is that `pybindings.PyModule` is dependent on the `method` getter from `pybindings.Module`, which `extension.Module` do not have. Since we don't want to expose `method` getter in `extension.Module`, we have to protect the getter, wrap the functions that is dependent on it and use the protected getter there, ultimately decouple `pybindings` from a `method` getter. # Proposal Now that we have a protected `method` getter, we can introduce a `extension.BundledModule`, a child class inheriting `extension.Module` which wraps up bundled program logic that is dependent on the `method` getter. Differential Revision: [D73564125](https://our.internmc.facebook.com/intern/diff/D73564125/) [ghstack-poisoned]
2 parents e2c53bd + f00a419 commit 053d845

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

devtools/bundled_program/bundled_program.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ ET_NODISCARD Error load_bundled_input(
267267
"testset_idx %zu is out of range [0, %u]",
268268
testset_idx,
269269
test_cases->size());
270-
auto bundled_inputs = test_cases->Get(static_cast<flatbuffers::uoffset_t>(testset_idx))->inputs();
270+
auto bundled_inputs =
271+
test_cases->Get(static_cast<flatbuffers::uoffset_t>(testset_idx))
272+
->inputs();
271273

272274
for (size_t input_idx = 0; input_idx < method.inputs_size(); input_idx++) {
273275
auto bundled_input = bundled_inputs->GetMutableObject(input_idx);
@@ -372,7 +374,8 @@ ET_NODISCARD Error verify_method_outputs(
372374
testset_idx,
373375
test_cases->size());
374376
auto bundled_expected_outputs =
375-
test_cases->Get(static_cast<flatbuffers::uoffset_t>(testset_idx))->expected_outputs();
377+
test_cases->Get(static_cast<flatbuffers::uoffset_t>(testset_idx))
378+
->expected_outputs();
376379

377380
if (bundled_expected_outputs->size() == 0) {
378381
// No bundled expected outputs, so we can't verify the method outputs.

0 commit comments

Comments
 (0)