Skip to content

Revert D76405701 #11661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions extension/module/bundled_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ std::unique_ptr<BufferDataLoader> program_data_loader(
}
} // namespace

namespace ET_BUNDLED_MODULE_NAMESPACE {

BundledModule::BundledModule(
const void* bundled_program_ptr,
std::unique_ptr<runtime::MemoryAllocator> memory_allocator,
Expand Down Expand Up @@ -109,6 +107,6 @@ runtime::Error BundledModule::verify_method_outputs(
return executorch::BUNDLED_PROGRAM_NAMESPACE::verify_method_outputs(
*method, bundled_program_ptr_, testset_idx, rtol, atol);
}
} // namespace ET_BUNDLED_MODULE_NAMESPACE

} // namespace extension
} // namespace executorch
11 changes: 0 additions & 11 deletions extension/module/bundled_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,9 @@

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

#ifdef USE_ATEN_LIB
#define ET_BUNDLED_MODULE_NAMESPACE bundled_module::aten
#else // !USE_ATEN_LIB
#define ET_BUNDLED_MODULE_NAMESPACE bundled_module
#endif // USE_ATEN_LIB

namespace executorch {
namespace extension {

using ET_MODULE_NAMESPACE::Module;

namespace ET_BUNDLED_MODULE_NAMESPACE {

/**
* A facade class for loading bundled programs and executing methods within
* them.
Expand Down Expand Up @@ -129,6 +119,5 @@ class BundledModule : public Module {
bool is_loaded_from_file_ = false;
};

} // namespace ET_BUNDLED_MODULE_NAMESPACE
} // namespace extension
} // namespace executorch
2 changes: 0 additions & 2 deletions extension/module/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

namespace executorch {
namespace extension {
namespace ET_MODULE_NAMESPACE {

using ET_RUNTIME_NAMESPACE::MethodMeta;
using ET_RUNTIME_NAMESPACE::Program;
Expand Down Expand Up @@ -309,6 +308,5 @@ runtime::Error Module::set_output(
output_tensor.mutable_data_ptr(), output_tensor.nbytes(), output_index);
}

} // namespace ET_MODULE_NAMESPACE
} // namespace extension
} // namespace executorch
21 changes: 2 additions & 19 deletions extension/module/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

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

#ifdef USE_ATEN_LIB
#define ET_MODULE_NAMESPACE module::aten
#else // !USE_ATEN_LIB
#define ET_MODULE_NAMESPACE module
#endif // USE_ATEN_LIB

namespace executorch {
namespace extension {

Expand All @@ -30,9 +24,6 @@ using ET_RUNTIME_NAMESPACE::MethodMeta;
using ET_RUNTIME_NAMESPACE::NamedDataMap;
using ET_RUNTIME_NAMESPACE::Program;

class ExecuTorchJni;

namespace ET_MODULE_NAMESPACE {
/**
* A facade class for loading programs and executing methods within them.
*/
Expand Down Expand Up @@ -502,24 +493,16 @@ class Module {
protected:
std::unordered_map<std::string, MethodHolder> methods_;

friend class executorch::extension::ExecuTorchJni;
friend class ExecuTorchJni;
};

} // namespace ET_MODULE_NAMESPACE
} // namespace extension
} // namespace executorch

namespace torch {
namespace executor {
// TODO(T197294990): Remove these deprecated aliases once all users have moved
// to the new `::executorch` namespaces.
using ::executorch::extension::ET_MODULE_NAMESPACE::Module;
using ::executorch::extension::Module;
} // namespace executor
} // namespace torch

namespace executorch {
namespace extension {
// backward compatible namespace alias
using ::executorch::extension::ET_MODULE_NAMESPACE::Module;
} // namespace extension
} // namespace executorch
2 changes: 1 addition & 1 deletion extension/module/test/bundled_module_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <executorch/extension/module/bundled_module.h>
#include <gtest/gtest.h>

using namespace ::executorch::extension::ET_BUNDLED_MODULE_NAMESPACE;
using namespace ::executorch::extension;
using namespace ::executorch::runtime;

class BundledModuleTest : public ::testing::Test {
Expand Down
Loading