!45206 fix dynamic and static memory graph boundary bug of getNext

Merge pull request !45206 from limingqi107/bug_fix3
This commit is contained in:
i-robot 2022-11-10 08:35:26 +00:00 committed by Gitee
commit a48acdfe06
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 9 additions and 0 deletions

View File

@ -558,6 +558,15 @@ KernelGraphPtr SchedulerHelper::FecthKernelGraphByActor(AbstractActor *const act
MS_EXCEPTION_IF_NULL(from_kernel);
}
// The device data source actor is from the GetNext cnode that is not a boundary of the graph and is equivalent to the
// kernel actor when inserted the memory actor.
if (actor->type() == KernelTransformType::kDeviceDataSourceActor) {
auto device_ds_actor = dynamic_cast<DeviceQueueDataSourceActor *>(actor);
MS_EXCEPTION_IF_NULL(device_ds_actor);
from_kernel = device_ds_actor->data_kernel().get();
MS_EXCEPTION_IF_NULL(from_kernel);
}
// Only the copy actor from device tensor store need to fetch the kernel graph, because the copy actor is not a
// boundary of the graph and is equivalent to the kernel actor when inserted the memory actor.
if ((actor->type() == KernelTransformType::kCopyActor) &&