[MSLITE] mindrt actor name unique

This commit is contained in:
ling 2021-07-16 18:40:46 +08:00
parent 2a6caf97cc
commit d41a56f7f2
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