Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
cpplint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerryzcn committed Sep 19, 2019
1 parent d6d08d5 commit 3c3ecb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/operator/contrib/bounding_box-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,17 @@ struct box_encode {
out_masks[a_index + 2] = valid;
out_masks[a_index + 3] = valid;
out_targets[a_index + 0] = valid > static_cast<DType>(0.5) ?
((ref_x - a_x) / a_width - static_cast<DType>(means[0])) / static_cast<DType>(stds[0]) : static_cast<DType>(0.0);
((ref_x - a_x) / a_width - static_cast<DType>(means[0])) /
static_cast<DType>(stds[0]) : static_cast<DType>(0.0);
out_targets[a_index + 1] = valid > static_cast<DType>(0.5) ?
((ref_y - a_y) / a_height - static_cast<DType>(means[1])) / static_cast<DType>(stds[1]) : static_cast<DType>(0.0);
((ref_y - a_y) / a_height - static_cast<DType>(means[1])) /
static_cast<DType>(stds[1]) : static_cast<DType>(0.0);
out_targets[a_index + 2] = valid > static_cast<DType>(0.5) ?
(log(ref_width / a_width) - static_cast<DType>(means[2])) / static_cast<DType>(stds[2]) : static_cast<DType>(0.0);
(log(ref_width / a_width) - static_cast<DType>(means[2])) /
static_cast<DType>(stds[2]) : static_cast<DType>(0.0);
out_targets[a_index + 3] = valid > static_cast<DType>(0.5) ?
(log(ref_height / a_height) - static_cast<DType>(means[3])) / static_cast<DType>(stds[3]) : static_cast<DType>(0.0);
(log(ref_height / a_height) - static_cast<DType>(means[3])) /
static_cast<DType>(stds[3]) : static_cast<DType>(0.0);
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/operator/contrib/bounding_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ NNVM_REGISTER_OP(_contrib_box_encode)
.set_attr<nnvm::FInferType>("FInferType", ElemwiseType<6, 2>)
.set_attr<FCompute>("FCompute<cpu>", BoxEncodeForward<cpu>)
.set_attr<nnvm::FGradient>("FGradient", MakeZeroGradNodes)
.add_argument("samples", "NDArray-or-Symbol", "(B, N) value +1 (positive), -1 (negative), 0 (ignore)")
.add_argument("samples", "NDArray-or-Symbol", "(B, N) value +1 (positive), -1 (negative), "
"0 (ignore)")
.add_argument("matches", "NDArray-or-Symbol", "(B, N) value range [0, M)")
.add_argument("anchors", "NDArray-or-Symbol", "(B, N, 4) encoded in corner")
.add_argument("refs", "NDArray-or-Symbol", "(B, N, 4) encoded in corner")
Expand Down

0 comments on commit 3c3ecb7

Please sign in to comment.