diff --git a/src/core/src/op/assign.cpp b/src/core/src/op/assign.cpp index 343b6a34e9c28a..ff2102135b32ac 100644 --- a/src/core/src/op/assign.cpp +++ b/src/core/src/op/assign.cpp @@ -119,12 +119,12 @@ bool Assign::evaluate(TensorVector& outputs, const auto var_value = variable_values.find(m_variable)->second; var_value->set_reset(false); - auto buffer = var_value->get_state(); - buffer.set_shape(inputs[0].get_shape()); + auto memory_buffer = var_value->get_state(); + memory_buffer.set_shape(inputs[0].get_shape()); outputs[0].set_shape(inputs[0].get_shape()); std::memcpy(outputs[0].data(), inputs[0].data(), inputs[0].get_byte_size()); - std::memcpy(buffer.data(), inputs[0].data(), inputs[0].get_byte_size()); + std::memcpy(memory_buffer.data(), inputs[0].data(), inputs[0].get_byte_size()); return true; } diff --git a/src/core/src/op/read_value.cpp b/src/core/src/op/read_value.cpp index 5cc9e9b575c6dd..11d4cf69188e0c 100644 --- a/src/core/src/op/read_value.cpp +++ b/src/core/src/op/read_value.cpp @@ -153,13 +153,14 @@ bool ReadValue::evaluate(TensorVector& outputs, const auto use_context = var_value != variable_values.end() && !var_value->second->get_reset(); auto& output = outputs[0]; + const auto& input = inputs[0]; if (use_context) { - const auto& ctx_tensor = var_value->second->get_state(); - output.set_shape(ctx_tensor.get_shape()); - std::memcpy(output.data(), ctx_tensor.data(), output.get_byte_size()); + const auto& memory_buffer = var_value->second->get_state(); + output.set_shape(memory_buffer.get_shape()); + std::memcpy(output.data(), memory_buffer.data(), output.get_byte_size()); } else { output.set_shape(inputs[0].get_shape()); - std::memset(output.data(), 0, output.get_byte_size()); + std::memcpy(output.data(), input.data(), output.get_byte_size()); } return true; }