Skip to content

Commit 85b839f

Browse files
emailweixuabhinavarora
authored andcommitted
Fix l1_norm_op and squared_l2_norm_op for debug mode (#5560)
1 parent b6c262e commit 85b839f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

paddle/operators/l1_norm_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class L1NormKernel : public framework::OpKernel<T> {
2929
Out->mutable_data<T>(context.GetPlace());
3030

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

3535
out.device(place) = x.abs().sum();

paddle/operators/squared_l2_norm_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SquaredL2NormKernel : public framework::OpKernel<T> {
2929
Out->mutable_data<T>(context.GetPlace());
3030

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

3535
out.device(place) = x.square().sum();

0 commit comments

Comments
 (0)