updated to reset variable memory when shape is changed (#18941)

This commit is contained in:
Eddy Kim 2023-08-03 03:24:58 +09:00 committed by GitHub
parent 1fd598c303
commit 9e9cf72973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1694,6 +1694,7 @@ void network::update_variable_memory(const std::string& variable_id, const cldnn
it->second->set_memory(get_engine().reinterpret_buffer(*it->second->memory, layout)); it->second->set_memory(get_engine().reinterpret_buffer(*it->second->memory, layout));
else else
it->second->set_memory(get_engine().allocate_memory(layout, false)); it->second->set_memory(get_engine().allocate_memory(layout, false));
it->second->is_set = false;
} }
for (auto primitive : _variable_state_primitives) { for (auto primitive : _variable_state_primitives) {
if (const auto& memory_state_primitive = std::dynamic_pointer_cast<memory_state::variable>(primitive)) { if (const auto& memory_state_primitive = std::dynamic_pointer_cast<memory_state::variable>(primitive)) {