From a0863b46f69531e9ea65d5743ffac860d4b2445b Mon Sep 17 00:00:00 2001 From: Zhi Chen Date: Sat, 9 Mar 2019 04:16:30 +0000 Subject: [PATCH] remove required method --- include/tvm/relay/pass.h | 5 ---- src/relay/pass/pass_manager.cc | 47 ---------------------------------- 2 files changed, 52 deletions(-) diff --git a/include/tvm/relay/pass.h b/include/tvm/relay/pass.h index d1289a1e0699..db19386bcd5c 100644 --- a/include/tvm/relay/pass.h +++ b/include/tvm/relay/pass.h @@ -144,11 +144,6 @@ class PassNode : public RelayNode { */ virtual void SetContext(const PassContext& pass_ctx) = 0; - /*! - * \brief Get the required passes for this pass as a vector of std::string. - */ - virtual std::vector Required() const = 0; - /*! * \brief Execute the optimization pass using a functor. * diff --git a/src/relay/pass/pass_manager.cc b/src/relay/pass/pass_manager.cc index a08bf27d2b06..5478dcd6ff6c 100644 --- a/src/relay/pass/pass_manager.cc +++ b/src/relay/pass/pass_manager.cc @@ -47,9 +47,6 @@ class ModulePassNode : public PassNode { */ Module operator()(const Module& mod) const final; - /*! \brief Collect the required passes for this module pass. */ - std::vector Required() const final; - /*! * \brief Get the pass information/meta data. */ @@ -116,9 +113,6 @@ class FunctionPassNode : public PassNode { */ Module operator()(const Module& mod) const final; - /*! \brief Collect the required passes for this module pass. */ - std::vector Required() const final; - /*! * \brief Get the pass information/meta data. */ @@ -217,8 +211,6 @@ class SequentialPassNode : public PassNode { */ void ResolveDependency(const Module& mod); - std::vector Required() const final; - TVM_DLL std::vector DisabledPasses() const; /*! @@ -289,19 +281,6 @@ Module ModulePassNode::operator()(const Module& mod) const { return updated_mod; } -std::vector ModulePassNode::Required() const { - std::vector required; - PassInfo pass_info = GetPassInfo(); - CHECK(pass_info.defined()) - << "Cannot get the required passes from undefined PassInfo object." - << "\n"; - for (const auto& it : pass_info.operator->()->required) { - const auto* str = it.as(); - required.push_back(str->value); - } - return required; -} - void ModulePassNode::SetContext(const PassContext& pass_ctx) { pass_ctx_ = pass_ctx; } @@ -352,19 +331,6 @@ bool FunctionPassNode::SkipFunction(const Function& func) const { return pval && pval->value != 0; } -std::vector FunctionPassNode::Required() const { - std::vector required; - PassInfo pass_info = GetPassInfo(); - CHECK(pass_info.defined()) - << "Cannot get the required passes from undefined PassInfo object." - << "\n"; - for (const auto& it : pass_info.operator->()->required) { - const auto* str = it.as(); - required.push_back(str->value); - } - return required; -} - SequentialPass SequentialPassNode::make(PassInfo pass_info, tvm::Array passes, tvm::Array disabled) { @@ -388,19 +354,6 @@ Module SequentialPassNode::operator()(const Module& module) const { return mod; } -std::vector SequentialPassNode::Required() const { - std::vector required; - PassInfo pass_info = GetPassInfo(); - CHECK(pass_info.defined()) - << "Cannot get the required passes from undefined PassInfo object." - << "\n"; - for (const auto& it : pass_info.operator->()->required) { - const auto* str = it.as(); - required.push_back(str->value); - } - return required; -} - void SequentialPassNode::ResolveDependency(const Module& mod) { // TODO(zhiics) Implement it. // 1. Consider the required passes for each pass.