未验证 提交 661f4094 编写于 作者: F Fan Zhang 提交者: GitHub

[CPU-PSLIB] Add clearer error log when sparse key name is not int type, test=develop (#34173)

上级 5ce58d57
......@@ -914,7 +914,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.
先完成此消息的编辑!
想要评论请 注册