Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions paddle/fluid/distributed/ps/wrapper/fleet.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,10 @@ class FleetWrapper {
const std::string& msg);

std::string GetDistDesc() const {
CHECK(is_initialized_ == true)
<< "FleetWrapper should be initialized first!!!";
PADDLE_ENFORCE_EQ(is_initialized_,
true,
phi::errors::PermissionDenied(
"FleetWrapper should be initialized first!!!"));
return dist_desc_;
}

Expand Down
5 changes: 4 additions & 1 deletion paddle/fluid/inference/capi/pd_predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ bool PD_PredictorZeroCopyRun(const PD_AnalysisConfig* config,
}
}
VLOG(3) << "Run ZeroCopyRun() in CAPI encapsulation. ";
CHECK(predictor->ZeroCopyRun());
PADDLE_ENFORCE_EQ(
predictor->ZeroCopyRun(),
true,
phi::errors::PermissionDenied("Predictor is not in Zero Copy Run!!!"));
auto output_names = predictor->GetOutputNames();
int osize = output_names.size();
*out_size = osize;
Expand Down
6 changes: 5 additions & 1 deletion paddle/fluid/inference/tensorrt/convert/leaky_relu_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class LeakyReluOpConverter : public OpConverter {

bool enable_int8 = op_desc.HasAttr("enable_int8");
if (enable_int8) {
CHECK(op_desc.HasAttr("Input_scale"));
PADDLE_ENFORCE_EQ(
op_desc.HasAttr("Input_scale"),
true,
phi::errors::InvalidArgument(
"Operator description does not has attribute Input_scale!!!"));
float in_scale = PADDLE_GET_CONST(float, op_desc.GetAttr("Input_scale"));
engine_->SetTensorDynamicRange(input, in_scale);
}
Expand Down