We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cf1f35 commit f326b01Copy full SHA for f326b01
paddle/fluid/framework/scope.cc
@@ -78,6 +78,7 @@ Variable* Scope::FindVarInternal(const std::string& name) const {
78
}
79
80
const Scope* Scope::FindScope(const Variable* var) const {
81
+ std::unique_lock<std::mutex> lock(mutex_);
82
for (auto& kv : vars_) {
83
if (kv.second.get() == var) {
84
return this;
@@ -127,6 +128,7 @@ void Scope::EraseVars(const std::vector<std::string>& var_names) {
127
128
129
void Scope::Rename(const std::string& origin_name,
130
const std::string& new_name) const {
131
132
auto origin_it = vars_.find(origin_name);
133
PADDLE_ENFORCE(origin_it != vars_.end(),
134
"Cannot find original variable with name %s", origin_name);
0 commit comments