未验证 提交 7dcf5e53 编写于 作者: N niuliling123 提交者: GitHub

Fix core dumped in training when check_nan_inf=1

上级 26c3077a
......@@ -115,7 +115,9 @@ void CheckTensorHasNanOrInf(const std::string& api_name, const Tensor& tensor) {
void CheckTensorHasNanOrInf(const std::string& api_name,
const paddle::optional<Tensor>& tensor) {
CheckTensorHasNanOrInf(api_name, tensor.get());
if (tensor) {
CheckTensorHasNanOrInf(api_name, *tensor);
}
}
void CheckTensorHasNanOrInf(const std::string& api_name,
......@@ -169,7 +171,7 @@ void CheckTensorHasNanOrInf(
const std::string& api_name,
const paddle::optional<std::vector<Tensor>>& tensors) {
if (tensors) {
CheckTensorHasNanOrInf(api_name, tensors.get());
CheckTensorHasNanOrInf(api_name, *tensors);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册