Fix comment for norm_op

detection_output_fixbug
xuwei06 7 years ago
parent 6ecbf08372
commit 0ef9dc6122

@ -39,7 +39,7 @@ class NormOpMaker : public framework::OpProtoAndCheckerMaker {
"M = C * H * W"); "M = C * H * W");
AddComment(R"DOC( AddComment(R"DOC(
"Input shape: $(N, C, H, W)$ "Input shape: $(N, C, H, W)$
Sclae shape: $(C, 1)$ Scale shape: $(C, 1)$
Output shape: $(N, C, H, W)$ Output shape: $(N, C, H, W)$
Where Where
forward forward

@ -66,7 +66,7 @@ class NormKernel : public framework::OpKernel<T> {
context.GetPlace()); context.GetPlace());
auto tmp = framework::EigenVector<T, Eigen::RowMajor, auto tmp = framework::EigenVector<T, Eigen::RowMajor,
Eigen::DenseIndex>::Flatten(tmp_tensor); Eigen::DenseIndex>::Flatten(tmp_tensor);
// get colsum and sqrt , inverse // get colsum and sqrt , inverse
auto dim = Eigen::array<int, 1>({{0}}); auto dim = Eigen::array<int, 1>({{0}});
tmp.device(*place) = x_square_batch_eigen.sum(dim); tmp.device(*place) = x_square_batch_eigen.sum(dim);
tmp.device(*place) = (tmp + epsilon).sqrt().inverse(); tmp.device(*place) = (tmp + epsilon).sqrt().inverse();

Loading…
Cancel
Save