// // WhileModule.hpp // MNN // // Created by MNN on 2020/09/10. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef WhileModule_hpp #define WhileModule_hpp #include #include "core/Schedule.hpp" namespace MNN { namespace Express { class WhileModule : public Module { public: virtual ~ WhileModule() { // Do nothing } virtual std::vector onForward(const std::vector& inputs) override; static WhileModule* create(const Op* op, const std::map& subGraph); struct Info { int mCondInputNumber = 0; int mBodyInputNumber = 0; int mOutputNumber; // First mCondInputs' index, Second: inputs's index std::vector> mInputForCond; // First mBodyInputs' index, Second: inputs's index std::vector> mInputForBody; std::vector> mOutputFromBody; std::vector> mOutputFromBodyInput; std::vector mOutputFromInput; std::vector> mUpdateForCond; std::vector> mUpdateForBody; std::vector> mCondUpdateForCond; std::vector> mCondUpdateForBody; }; private: WhileModule(){} Module* clone(CloneContext* ctx) const override; std::shared_ptr mInfo; std::shared_ptr mCond; std::shared_ptr mBody; }; } } #endif