Skip to content

Commit d9946b2

Browse files
Update base for Update on "[ExecuTorch][#10447] Extend PyBundledModule with extension.BundledModule"
#10447 # 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`. # Proposal Now that we have `extension.BundledModule` ready, we want to test it out by having our existing `PyBundledModule` to extend it, and let `verify_result_with_bundled_expected_output` to use it, so that we can test out the whole thing with https://github.com/pytorch/executorch/blob/fb45e19055a92d2a91a4d4b7008e135232cbb14b/devtools/bundled_program/test/test_end2end.py Differential Revision: [D73564127](https://our.internmc.facebook.com/intern/diff/D73564127/) [ghstack-poisoned]
1 parent bea252c commit d9946b2

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

extension/module/bundled_module.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#define ET_BUNDLED_MODULE_NAMESPACE bundled_module
1717
#endif // USE_ATEN_LIB
1818

19-
using executorch::extension::ET_MODULE_NAMESPACE::Module;
20-
2119
namespace executorch {
2220
namespace extension {
2321
namespace ET_BUNDLED_MODULE_NAMESPACE {
2422

23+
using executorch::extension::ET_MODULE_NAMESPACE::Module;
24+
2525
/**
2626
* A facade class for loading bundled programs and executing methods within
2727
* them.

extension/module/module.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@
2424

2525
namespace executorch {
2626
namespace extension {
27-
namespace ET_MODULE_NAMESPACE {
2827

2928
using ET_RUNTIME_NAMESPACE::Method;
3029
using ET_RUNTIME_NAMESPACE::MethodMeta;
3130
using ET_RUNTIME_NAMESPACE::NamedDataMap;
3231
using ET_RUNTIME_NAMESPACE::Program;
3332

33+
class ExecuTorchJni;
34+
35+
namespace ET_MODULE_NAMESPACE {
36+
3437
/**
3538
* A facade class for loading programs and executing methods within them.
3639
*/
@@ -500,7 +503,7 @@ class Module {
500503
protected:
501504
std::unordered_map<std::string, MethodHolder> methods_;
502505

503-
friend class ExecuTorchJni;
506+
friend class executorch::extension::ExecuTorchJni;
504507
};
505508

506509
} // namespace ET_MODULE_NAMESPACE
@@ -518,6 +521,6 @@ using ::executorch::extension::ET_MODULE_NAMESPACE::Module;
518521
namespace executorch {
519522
namespace extension {
520523
// backward compatible namespace alias
521-
using namespace ::executorch::extension::ET_MODULE_NAMESPACE;
524+
using ::executorch::extension::ET_MODULE_NAMESPACE::Module;
522525
} // namespace extension
523526
} // namespace executorch

0 commit comments

Comments
 (0)