Skip to content

Commit

Permalink
fix npu compile
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiu committed Oct 28, 2021
1 parent a1a9324 commit 1cc0bb0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions paddle/fluid/framework/details/nan_inf_utils_detail.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static framework::Tensor& npu_float_status() {
}

void NPUAllocAndClearFloatStatus(const framework::OperatorBase& op,
const framework::Scope& scope,
const framework::ScopeBase& scope,
const platform::Place& place) {
if (!platform::is_npu_place(place)) return;

Expand Down Expand Up @@ -505,7 +505,7 @@ void PrintNpuVarInfo(const std::string& op_type, const std::string& var_name,
}

void PrintNPUOpValueInfo(const framework::OperatorBase& op,
const framework::Scope& scope,
const framework::ScopeBase& scope,
const platform::Place& place) {
LOG(WARNING) << "There are `nan` or `inf` in operator (" << op.Type()
<< "), here we print some tensor value info of this op.";
Expand Down Expand Up @@ -551,9 +551,8 @@ static void NPUCheckOpHasNanOrInf(const framework::OperatorBase& op,

if (sum >= 1.0) PrintNPUOpValueInfo(op, scope, place);

PADDLE_ENFORCE_LT(
sum, 1.0, platform::errors::PreconditionNotMet(
"Operator %s contains Nan/Inf.", op.DebugStringEx(&scope)));
PADDLE_ENFORCE_LT(sum, 1.0, platform::errors::PreconditionNotMet(
"Operator %s contains Nan/Inf.", op.Type()));
}
#endif

Expand Down

1 comment on commit 1cc0bb0

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.