提交 c0ddb93c 编写于 作者: M minqiyang

Polish code

test=develop
上级 f8373949
......@@ -55,14 +55,11 @@ class GradOpDescMakerBase {
std::back_inserter(ret_val),
[this](const std::string& fwd_var_name) -> std::string {
auto g_name = GradVarName(fwd_var_name);
if (no_grad_set_.empty()) {
if (no_grad_set_.empty() || !no_grad_set_.count(g_name)) {
(*this->grad_to_var_)[g_name] = fwd_var_name;
return g_name;
} else if (no_grad_set_.count(g_name)) {
return kEmptyVarName;
} else {
(*this->grad_to_var_)[g_name] = fwd_var_name;
return g_name;
return kEmptyVarName;
}
});
if (!drop_empty_grad) {
......
......@@ -36,13 +36,11 @@ static bool gTracerProfilerStarted = false;
#endif
void StartProfile() {
LOG(ERROR) << "XX " << FLAGS_tracer_profile_fname;
if (!FLAGS_tracer_profile_fname.empty()) {
std::call_once(gTracerProfileOnce, [] {
#ifdef WITH_GPERFTOOLS
ProfilerStart(FLAGS_tracer_profile_fname.c_str());
gTracerProfilerStarted = true;
LOG(ERROR) << "YY";
#else
LOG(WARNING) << "Paddle is not compiled with gperftools. "
"FLAGS_tracer_profile_fname will be ignored";
......@@ -52,7 +50,6 @@ void StartProfile() {
}
void StopProfile() {
LOG(ERROR) << "ZZ " << FLAGS_tracer_profile_fname;
#ifdef WITH_GPERFTOOLS
ProfilerFlush();
#else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册