Skip to content

Commit

Permalink
Fix l1_norm_op and squared_l2_norm_op for debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei06 committed Nov 13, 2017
1 parent 3971586 commit dfe8d5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paddle/operators/l1_norm_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class L1NormKernel : public framework::OpKernel<T> {
Out->mutable_data<T>(context.GetPlace());

auto x = framework::EigenVector<T>::Flatten(*X);
auto out = framework::EigenVector<T>::Flatten(*Out);
auto out = framework::EigenScalar<T>::From(*Out);
auto place = context.GetEigenDevice<Place>();

out.device(place) = x.abs().sum();
Expand Down
2 changes: 1 addition & 1 deletion paddle/operators/squared_l2_norm_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SquaredL2NormKernel : public framework::OpKernel<T> {
Out->mutable_data<T>(context.GetPlace());

auto x = framework::EigenVector<T>::Flatten(*X);
auto out = framework::EigenVector<T>::Flatten(*Out);
auto out = framework::EigenScalar<T>::From(*Out);
auto place = context.GetEigenDevice<Place>();

out.device(place) = x.square().sum();
Expand Down

0 comments on commit dfe8d5e

Please sign in to comment.