| 674 | } |
| 675 | |
| 676 | Module* StaticModule::clone(CloneContext* ctx) const { |
| 677 | StaticModule* module(new StaticModule); |
| 678 | module->mResource = mResource; |
| 679 | module->mRuntimeManager = ctx->pRuntimeManager; |
| 680 | if (mResource->mOutputFromTensor.empty()) { |
| 681 | return this->cloneBaseTo(ctx, module); |
| 682 | } |
| 683 | // mSession->clone may construct new Backends. |
| 684 | ctx->pRuntimeManager->applyMetaToRuntime(); |
| 685 | auto rt = ctx->pRuntimeManager->getInside()->mRuntime; |
| 686 | module->mSession.reset(mSession->clone(std::move(rt), mResource->mSharedConst)); |
| 687 | module->resetInputOutputs(); |
| 688 | return this->cloneBaseTo(ctx, module); |
| 689 | } |
| 690 | int StaticModule::onOptimize(Interpreter::SessionMode stage) { |
| 691 | int res = 0; |
| 692 | switch (stage) { |
nothing calls this directly
no test coverage detected