Skip to content

Commit 121990b

Browse files
Gasoonjiafacebook-github-bot
authored andcommitted
Revert D76405701
Summary: This diff reverts D76405701 Depends on D76632995 (The context such as a Sandcastle job, Task, SEV, etc. was not provided.) Depends on D76405701 Differential Revision: D76633014
1 parent 8cfa858 commit 121990b

File tree

5 files changed

+4
-36
lines changed

5 files changed

+4
-36
lines changed

extension/module/bundled_module.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ std::unique_ptr<BufferDataLoader> program_data_loader(
2727
}
2828
} // namespace
2929

30-
namespace ET_BUNDLED_MODULE_NAMESPACE {
31-
3230
BundledModule::BundledModule(
3331
const void* bundled_program_ptr,
3432
std::unique_ptr<runtime::MemoryAllocator> memory_allocator,
@@ -109,6 +107,6 @@ runtime::Error BundledModule::verify_method_outputs(
109107
return executorch::BUNDLED_PROGRAM_NAMESPACE::verify_method_outputs(
110108
*method, bundled_program_ptr_, testset_idx, rtol, atol);
111109
}
112-
} // namespace ET_BUNDLED_MODULE_NAMESPACE
110+
113111
} // namespace extension
114112
} // namespace executorch

extension/module/bundled_module.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,9 @@
1010

1111
#include <executorch/extension/module/module.h>
1212

13-
#ifdef USE_ATEN_LIB
14-
#define ET_BUNDLED_MODULE_NAMESPACE bundled_module::aten
15-
#else // !USE_ATEN_LIB
16-
#define ET_BUNDLED_MODULE_NAMESPACE bundled_module
17-
#endif // USE_ATEN_LIB
18-
1913
namespace executorch {
2014
namespace extension {
2115

22-
using ET_MODULE_NAMESPACE::Module;
23-
24-
namespace ET_BUNDLED_MODULE_NAMESPACE {
25-
2616
/**
2717
* A facade class for loading bundled programs and executing methods within
2818
* them.
@@ -129,6 +119,5 @@ class BundledModule : public Module {
129119
bool is_loaded_from_file_ = false;
130120
};
131121

132-
} // namespace ET_BUNDLED_MODULE_NAMESPACE
133122
} // namespace extension
134123
} // namespace executorch

extension/module/module.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
namespace executorch {
3838
namespace extension {
39-
namespace ET_MODULE_NAMESPACE {
4039

4140
using ET_RUNTIME_NAMESPACE::MethodMeta;
4241
using ET_RUNTIME_NAMESPACE::Program;
@@ -309,6 +308,5 @@ runtime::Error Module::set_output(
309308
output_tensor.mutable_data_ptr(), output_tensor.nbytes(), output_index);
310309
}
311310

312-
} // namespace ET_MODULE_NAMESPACE
313311
} // namespace extension
314312
} // namespace executorch

extension/module/module.h

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616

1717
#include <executorch/runtime/executor/program.h>
1818

19-
#ifdef USE_ATEN_LIB
20-
#define ET_MODULE_NAMESPACE module::aten
21-
#else // !USE_ATEN_LIB
22-
#define ET_MODULE_NAMESPACE module
23-
#endif // USE_ATEN_LIB
24-
2519
namespace executorch {
2620
namespace extension {
2721

@@ -30,9 +24,6 @@ using ET_RUNTIME_NAMESPACE::MethodMeta;
3024
using ET_RUNTIME_NAMESPACE::NamedDataMap;
3125
using ET_RUNTIME_NAMESPACE::Program;
3226

33-
class ExecuTorchJni;
34-
35-
namespace ET_MODULE_NAMESPACE {
3627
/**
3728
* A facade class for loading programs and executing methods within them.
3829
*/
@@ -502,24 +493,16 @@ class Module {
502493
protected:
503494
std::unordered_map<std::string, MethodHolder> methods_;
504495

505-
friend class executorch::extension::ExecuTorchJni;
496+
friend class ExecuTorchJni;
506497
};
507498

508-
} // namespace ET_MODULE_NAMESPACE
509499
} // namespace extension
510500
} // namespace executorch
511501

512502
namespace torch {
513503
namespace executor {
514504
// TODO(T197294990): Remove these deprecated aliases once all users have moved
515505
// to the new `::executorch` namespaces.
516-
using ::executorch::extension::ET_MODULE_NAMESPACE::Module;
506+
using ::executorch::extension::Module;
517507
} // namespace executor
518508
} // namespace torch
519-
520-
namespace executorch {
521-
namespace extension {
522-
// backward compatible namespace alias
523-
using ::executorch::extension::ET_MODULE_NAMESPACE::Module;
524-
} // namespace extension
525-
} // namespace executorch

extension/module/test/bundled_module_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <executorch/extension/module/bundled_module.h>
1010
#include <gtest/gtest.h>
1111

12-
using namespace ::executorch::extension::ET_BUNDLED_MODULE_NAMESPACE;
12+
using namespace ::executorch::extension;
1313
using namespace ::executorch::runtime;
1414

1515
class BundledModuleTest : public ::testing::Test {

0 commit comments

Comments
 (0)