From 12d17941a1011bcec451409ee5d8bf096ac4d6cc Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Wed, 6 Jun 2018 14:29:05 +0800 Subject: [PATCH] fix a bug --- paddle/fluid/operators/reverse_op.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/reverse_op.h b/paddle/fluid/operators/reverse_op.h index d3c54b7318..9063cd59bb 100644 --- a/paddle/fluid/operators/reverse_op.h +++ b/paddle/fluid/operators/reverse_op.h @@ -24,8 +24,8 @@ struct ReverseFunctor { void operator()(const DeviceContext& context, const framework::LoDTensor& in, framework::LoDTensor* out, const std::vector& axis) { Eigen::array reverse_axis; - for (auto& i : reverse_axis) { - i = false; + for (int i = 0; i < Rank; ++i) { + reverse_axis[i] = false; } for (int a : axis) { reverse_axis[a] = true; -- GitLab