Add check for nullptr in PlannerImpl::FindReusableTensor(). (#3619)

This commit is contained in:
edgchen1 2020-04-22 20:18:29 -07:00 committed by GitHub
parent 0e12d05cd2
commit 2dd4f7e96b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -330,6 +330,11 @@ class PlannerImpl {
for (auto it = freelist_.begin(); it != freelist_.end(); ++it) {
size_t reusable = static_cast<size_t>(it->ml_value);
const onnxruntime::NodeArg* p_node_arg = ort_value_info_.at(reusable).p_def_site;
if (!p_node_arg) {
// TODO this should be an error case, needs more investigation
// https://msdata.visualstudio.com/Vienna/_workitems/edit/724826/
continue;
}
auto& available_memory_info = AllocPlan(p_node_arg->Name()).location;
if (!(available_memory_info == required_memory_info)) continue;
auto p_available_buffer_shape = context_.GetShape(*p_node_arg);