Skip to content

Commit

Permalink
support erf fp64 error (#51241)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiabinYang authored Mar 7, 2023
1 parent c2c1cfc commit db82b9e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions paddle/fluid/prim/api/manual_prim/static_prim_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ Tensor full<DescTensor>(const IntArray& shape,
case phi::DataType::FLOAT32:
op->SetAttr("value", value.to<float>());
break;
case phi::DataType::FLOAT64:
op->SetAttr("str_value", std::to_string(value.to<double>()));
case phi::DataType::FLOAT64: {
std::stringstream ss;
ss << std::setprecision(20) << value.to<double>();
op->SetAttr("str_value", ss.str());
break;
}
case phi::DataType::BOOL:
op->SetAttr("str_value", std::to_string(value.to<bool>()));
break;
Expand Down

0 comments on commit db82b9e

Please sign in to comment.