未验证 提交 6e4c2c5a 编写于 作者: F Fan Zhang 提交者: GitHub

[CPU-PSLIB] Add clearer error log when sparse key name is not int type,...

[CPU-PSLIB] Add clearer error log when sparse key name is not int type, test=develop (#34173) (#34206)
上级 e0aa1d65
......@@ -575,7 +575,14 @@ void FleetWrapper::PushSparseVarsWithLabelAsync(
int64_t* ids = tensor->data<int64_t>();
int slot = 0;
if (dump_slot) {
slot = boost::lexical_cast<int>(sparse_key_names[i]);
try {
slot = boost::lexical_cast<int>(sparse_key_names[i]);
} catch (boost::bad_lexical_cast const& e) {
PADDLE_THROW(platform::errors::PreconditionNotMet(
"sparse var's name: %s, doesn't support non-integer type name when "
"dump_slot=True",
sparse_key_names[i]));
}
}
Variable* g_var = scope.FindVar(sparse_grad_names[i]);
if (g_var == nullptr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册