Skip to content

Commit d7a371c

Browse files
committed
follow comments
1 parent 93734a7 commit d7a371c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

paddle/operators/prior_box_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class PriorBoxOpMaker : public framework::OpProtoAndCheckerMaker {
128128
"Prior boxes step across width, 0 for auto calculation.")
129129
.SetDefault(0.0)
130130
.AddCustomChecker([](const float& step_w) {
131-
PADDLE_ENFORCE_GT(step_w, 0.0, "step_h should be larger than 0.");
131+
PADDLE_ENFORCE_GT(step_w, 0.0, "step_w should be larger than 0.");
132132
});
133133
AddAttr<float>("step_h",
134134
"Prior boxes step across height, 0 for auto calculation.")

paddle/operators/prior_box_op.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ inline void ExpandAspectRatios(const std::vector<float>& input_aspect_ratior,
2525
std::vector<float>& output_aspect_ratior) {
2626
constexpr float epsilon = 1e-6;
2727
output_aspect_ratior.clear();
28-
output_aspect_ratior.push_back(1.);
28+
output_aspect_ratior.push_back(1.0f);
2929
for (size_t i = 0; i < input_aspect_ratior.size(); ++i) {
3030
float ar = input_aspect_ratior[i];
3131
bool already_exist = false;
@@ -38,7 +38,7 @@ inline void ExpandAspectRatios(const std::vector<float>& input_aspect_ratior,
3838
if (!already_exist) {
3939
output_aspect_ratior.push_back(ar);
4040
if (flip) {
41-
output_aspect_ratior.push_back(1. / ar);
41+
output_aspect_ratior.push_back(1.0f / ar);
4242
}
4343
}
4444
}

0 commit comments

Comments
 (0)