!20424 [MSLITE] mindrt actor name unique

Merge pull request !20424 from ling/mindrt
This commit is contained in:
i-robot 2021-07-17 06:56:31 +00:00 committed by Gitee
commit 9b4e61cd4b
2 changed files with 4 additions and 0 deletions

View File

@ -727,6 +727,9 @@ std::vector<std::shared_ptr<LiteOpActor>> CreateOpActor(const std::vector<kernel
return actors;
}
for (auto &kernel : kernels) {
/* make subgraph name (actor name) unique */
kernel->set_name(kernel->name() + to_string(actor_count++));
if ((kernel::LiteKernelUtil::IsSwitchCall(kernel))) {
auto switch_actor = std::make_shared<LiteSwitchOpActor>(kernel);
if (switch_actor == nullptr) {

View File

@ -150,6 +150,7 @@ class LiteSwitchOpActor : public LiteOpActor {
int MindrtInit();
void MindrtTerminate(const std::vector<std::shared_ptr<LiteOpActor>> &);
static std::atomic_int64_t actor_count = 0;
std::vector<std::shared_ptr<LiteOpActor>> CreateOpActor(const std::vector<kernel::LiteKernel *> &kernels,
const lite::InnerContext *ctx);
} // namespace mindspore::lite