未验证 提交 db82b9e2 编写于 作者: J Jiabin Yang 提交者: GitHub

support erf fp64 error (#51241)

上级 c2c1cfc7
...@@ -76,9 +76,12 @@ Tensor full<DescTensor>(const IntArray& shape, ...@@ -76,9 +76,12 @@ Tensor full<DescTensor>(const IntArray& shape,
case phi::DataType::FLOAT32: case phi::DataType::FLOAT32:
op->SetAttr("value", value.to<float>()); op->SetAttr("value", value.to<float>());
break; break;
case phi::DataType::FLOAT64: case phi::DataType::FLOAT64: {
op->SetAttr("str_value", std::to_string(value.to<double>())); std::stringstream ss;
ss << std::setprecision(20) << value.to<double>();
op->SetAttr("str_value", ss.str());
break; break;
}
case phi::DataType::BOOL: case phi::DataType::BOOL:
op->SetAttr("str_value", std::to_string(value.to<bool>())); op->SetAttr("str_value", std::to_string(value.to<bool>()));
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册