forked from mindspore-Ecosystem/mindspore
!30590 [MS][LITE]fix control model stuck on Samsung phone
Merge pull request !30590 from mengyuanli/bugfix
This commit is contained in:
commit
e932eb3ca3
|
@ -143,14 +143,25 @@ int LiteExitOpActor::PreInit(std::vector<std::shared_ptr<LiteOpActor>> *actors,
|
|||
return RET_OK;
|
||||
}
|
||||
|
||||
bool LiteExitOpActor::IsSubSet(const std::vector<lite::Tensor *> &all_set, const std::vector<lite::Tensor *> &sub_set) {
|
||||
if (sub_set.size() > all_set.size()) {
|
||||
return false;
|
||||
}
|
||||
for (auto &sub_item : sub_set) {
|
||||
if (std::find(all_set.begin(), all_set.end(), sub_item) == all_set.end()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int LiteExitOpActor::RecordCallNodeOutputActor(std::vector<std::shared_ptr<LiteOpActor>> *actors) {
|
||||
actors_ = actors;
|
||||
for (auto actor : *actors_) {
|
||||
auto actor_in_tensors = actor->GetKernel()->in_tensors();
|
||||
for (auto &info : all_mapping_info_) {
|
||||
auto &call = info.call_node;
|
||||
if (std::includes(actor_in_tensors.begin(), actor_in_tensors.end(), call->out_tensors().begin(),
|
||||
call->out_tensors().end())) {
|
||||
if (IsSubSet(actor_in_tensors, call->out_tensors())) {
|
||||
info.call_output_aid = actor->GetAID();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ class LiteExitOpActor : public LiteOpActor {
|
|||
int RecordCallNodeOutputActor(std::vector<std::shared_ptr<LiteOpActor>> *actors);
|
||||
void RecordPartialNodeInputActor();
|
||||
void SetEntranceInputAID(OpData<Tensor> *inputs);
|
||||
bool IsSubSet(const std::vector<lite::Tensor *> &all_set, const std::vector<lite::Tensor *> &sub_set);
|
||||
|
||||
std::vector<std::shared_ptr<LiteOpActor>> *actors_{};
|
||||
std::vector<MappingInfo> all_mapping_info_{};
|
||||
|
|
|
@ -18,8 +18,7 @@ ControlOneIfOneScaleOneScale.mindir;3
|
|||
add_if_while.mindir;3
|
||||
add_if_after_while_after_for.mindir;3
|
||||
add_if_after_if.mindir;3
|
||||
#stuck in sumsang phone
|
||||
#add_for_while.mindir;3
|
||||
add_for_while.mindir;3
|
||||
add_for_if.mindir;3
|
||||
switchlayer.mindir;3
|
||||
HDC_multimedia_3M_vit32_60ep_clip_vit_base_image.mindir 3
|
||||
|
|
Loading…
Reference in New Issue