From dc8390d8c3038173d70d4c7cc9f4e76bb1ddc587 Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Thu, 1 Feb 2018 13:46:35 -0800 Subject: [PATCH 01/55] initial commit --- .../tests/book/test_rnn_encoder_decoder.py | 51 +++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py b/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py index fdc60861760..593d0013c9d 100644 --- a/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py +++ b/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py @@ -145,7 +145,7 @@ def seq_to_seq_net(): cost = fluid.layers.cross_entropy(input=prediction, label=label) avg_cost = fluid.layers.mean(x=cost) - return avg_cost + return avg_cost, prediction def to_lodtensor(data, place): @@ -163,8 +163,8 @@ def to_lodtensor(data, place): return res -def main(): - avg_cost = seq_to_seq_net() +def train(save_dirname=None): + [avg_cost, prediction] = seq_to_seq_net() optimizer = fluid.optimizer.Adagrad(learning_rate=1e-4) optimizer.minimize(avg_cost) @@ -196,9 +196,52 @@ def main(): print('pass_id=' + str(pass_id) + ' batch=' + str(batch_id) + " avg_cost=" + str(avg_cost_val)) if batch_id > 3: + if save_dirname is not None: + fluid.io.save_inference_model(save_dirname, [ + 'source_sequence', 'target_sequence', 'label_sequence' + ], [prediction], exe) exit(0) batch_id += 1 +def inference(save_dirname=None): + if save_dirname is None: + return + + place = fluid.CPUPlace() + exe = fluid.Executor(place) + + # Use fluid.io.load_inference_model to obtain the inference program desc, + # the feed_target_names (the names of variables that will be feeded + # data using feed operators), and the fetch_targets (variables that + # we want to obtain data from using fetch operators). + [inference_program, feed_target_names, + fetch_targets] = fluid.io.load_inference_model(save_dirname, exe) + + data = [[0, 1, 0, 1], [0, 1, 1, 0, 0, 1]] + word_data = to_lodtensor(data, place) + trg_word = to_lodtensor(data, place) + trg_word_next = to_lodtensor(data, place) + + # Construct feed as a dictionary of {feed_target_name: feed_target_data} + # and results will contain a list of data corresponding to fetch_targets. + print(feed_target_names) + assert feed_target_names[0] == 'source_sequence' + assert feed_target_names[1] == 'target_sequence' + assert feed_target_names[2] == 'label_sequence' + results = exe.run(inference_program, + feed={ + feed_target_names[0]: word_data, + feed_target_names[1]: trg_word, + feed_target_names[2]: trg_word_next + }, + fetch_list=fetch_targets) + + print("Inference Shape: ", results[0].shape) + print("infer results: ", results[0]) + + if __name__ == '__main__': - main() + save_dirname = "rnn_encoder_decoder.inference.model" + train(save_dirname) + infer(save_dirname) -- GitLab From 71a70f209ac63b6f351bd3c399ddff804da090f7 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Wed, 31 Jan 2018 17:07:51 +0800 Subject: [PATCH 02/55] refine gradient --- paddle/operators/layer_norm_op.cc | 42 ++++++++++++------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/paddle/operators/layer_norm_op.cc b/paddle/operators/layer_norm_op.cc index 1c6d2ae4d05..8fcac00e08f 100644 --- a/paddle/operators/layer_norm_op.cc +++ b/paddle/operators/layer_norm_op.cc @@ -291,32 +291,28 @@ class LayerNormGradKernel auto d_x_map = EigenMatrixMapRowMajor(d_x->data(), left, right); auto triple_product_func = [](T ele) { return ele * ele * ele; }; auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; + + auto inv_std_map = var_map.unaryExpr(inv_std_func).eval(); // TODO(zcd): these code can be refined if (d_scale) { auto scale_map = ConstEigenMatrixMapRowMajor(scale->data(), 1, right); // dy_dx - auto dx_end = var_map.unaryExpr(inv_std_func) - .replicate(1, right) - .cwiseProduct(d_y_map) - .cwiseProduct(scale_map.replicate(left, 1)); + auto dx_end = + inv_std_map.replicate(1, right).cwiseProduct(d_y_map).cwiseProduct( + scale_map.replicate(left, 1)); + // dy_dmean_dx - auto dx_mean = (T(-1.0) / right) * - var_map.unaryExpr(inv_std_func) - .replicate(1, right) - .cwiseProduct(d_y_map) - .cwiseProduct(scale_map.replicate(left, 1)) - .rowwise() - .sum() - .replicate(1, right); + auto dx_mean = + (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); + // dy_var_dx auto dvar_end_part = (x_map - mean_map.replicate(1, right)) .cwiseProduct(scale_map.replicate(left, 1)) .cwiseProduct(d_y_map) .rowwise() .sum(); - auto dvar_end = var_map.unaryExpr(inv_std_func) - .unaryExpr(triple_product_func) + auto dvar_end = inv_std_map.unaryExpr(triple_product_func) .cwiseProduct(dvar_end_part) .replicate(1, right); auto dx_var = @@ -326,24 +322,18 @@ class LayerNormGradKernel d_x_map = dx_end + dx_mean + dx_var; } else { // dy_dx - auto dx_end = var_map.unaryExpr(inv_std_func) - .replicate(1, right) - .cwiseProduct(d_y_map); + auto dx_end = inv_std_map.replicate(1, right).cwiseProduct(d_y_map); + // dy_dmean_dx - auto dx_mean = (T(-1.0) / right) * - var_map.unaryExpr(inv_std_func) - .replicate(1, right) - .cwiseProduct(d_y_map) - .rowwise() - .sum() - .replicate(1, right); + auto dx_mean = + (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); + // dy_var_dx auto dvar_end_part = (x_map - mean_map.replicate(1, right)) .cwiseProduct(d_y_map) .rowwise() .sum(); - auto dvar_end = var_map.unaryExpr(inv_std_func) - .unaryExpr(triple_product_func) + auto dvar_end = inv_std_map.unaryExpr(triple_product_func) .cwiseProduct(dvar_end_part) .replicate(1, right); auto dx_var = -- GitLab From 76e188e5c6b39fc7cccab9d5b64bd19163fafb77 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Fri, 2 Feb 2018 15:09:23 +0800 Subject: [PATCH 03/55] Add layer norm [GPU] --- paddle/operators/compare_op.h | 2 +- paddle/operators/elementwise_add_op.h | 3 +- paddle/operators/elementwise_div_op.h | 3 +- paddle/operators/elementwise_max_op.h | 3 +- paddle/operators/elementwise_min_op.h | 3 +- paddle/operators/elementwise_mul_op.h | 3 +- paddle/operators/elementwise_op_function.h | 4 +- paddle/operators/elementwise_pow_op.h | 3 +- paddle/operators/elementwise_sub_op.h | 3 +- paddle/operators/layer_norm_op.cc | 9 +- paddle/operators/layer_norm_op.cu | 245 +++++++++++++++++++++ paddle/operators/math/math_function.cc | 6 + paddle/operators/math/math_function.cu | 25 +++ paddle/operators/math/math_function.h | 12 + paddle/operators/math/math_function_impl.h | 82 +++++++ 15 files changed, 393 insertions(+), 13 deletions(-) create mode 100644 paddle/operators/layer_norm_op.cu diff --git a/paddle/operators/compare_op.h b/paddle/operators/compare_op.h index b275fd75b35..79b8c6f59c7 100644 --- a/paddle/operators/compare_op.h +++ b/paddle/operators/compare_op.h @@ -62,7 +62,7 @@ class CompareOpKernel z->mutable_data(context.GetPlace()); int axis = context.Attr("axis"); ElementwiseComputeEx(context, x, y, axis, - z); + Functor(), z); } }; diff --git a/paddle/operators/elementwise_add_op.h b/paddle/operators/elementwise_add_op.h index c32288d6984..c24f97a8509 100644 --- a/paddle/operators/elementwise_add_op.h +++ b/paddle/operators/elementwise_add_op.h @@ -35,7 +35,8 @@ class ElementwiseAddKernel : public framework::OpKernel { auto* z = ctx.Output("Out"); z->mutable_data(ctx.GetPlace()); int axis = ctx.Attr("axis"); - ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, z); + ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, + AddFunctor(), z); } }; diff --git a/paddle/operators/elementwise_div_op.h b/paddle/operators/elementwise_div_op.h index 07ebade31ff..dc863cc598e 100644 --- a/paddle/operators/elementwise_div_op.h +++ b/paddle/operators/elementwise_div_op.h @@ -35,7 +35,8 @@ class ElementwiseDivKernel : public framework::OpKernel { auto* z = ctx.Output("Out"); z->mutable_data(ctx.GetPlace()); int axis = ctx.Attr("axis"); - ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, z); + ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, + DivFunctor(), z); } }; diff --git a/paddle/operators/elementwise_max_op.h b/paddle/operators/elementwise_max_op.h index 717e45ab31d..67efe4e1511 100644 --- a/paddle/operators/elementwise_max_op.h +++ b/paddle/operators/elementwise_max_op.h @@ -35,7 +35,8 @@ class ElementwiseMaxKernel : public framework::OpKernel { auto* z = ctx.Output("Out"); z->mutable_data(ctx.GetPlace()); int axis = ctx.Attr("axis"); - ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, z); + ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, + MaxFunctor(), z); } }; diff --git a/paddle/operators/elementwise_min_op.h b/paddle/operators/elementwise_min_op.h index 0de9a91c52b..cf11759404d 100644 --- a/paddle/operators/elementwise_min_op.h +++ b/paddle/operators/elementwise_min_op.h @@ -35,7 +35,8 @@ class ElementwiseMinKernel : public framework::OpKernel { auto* z = ctx.Output("Out"); z->mutable_data(ctx.GetPlace()); int axis = ctx.Attr("axis"); - ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, z); + ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, + MinFunctor(), z); } }; diff --git a/paddle/operators/elementwise_mul_op.h b/paddle/operators/elementwise_mul_op.h index ae7a71e0244..773125f5ca5 100644 --- a/paddle/operators/elementwise_mul_op.h +++ b/paddle/operators/elementwise_mul_op.h @@ -34,7 +34,8 @@ class ElementwiseMulKernel : public framework::OpKernel { auto* z = ctx.Output("Out"); z->mutable_data(ctx.GetPlace()); int axis = ctx.Attr("axis"); - ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, z); + ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, + MulFunctor(), z); } }; diff --git a/paddle/operators/elementwise_op_function.h b/paddle/operators/elementwise_op_function.h index 213fe1f5a81..74abf7c4a58 100644 --- a/paddle/operators/elementwise_op_function.h +++ b/paddle/operators/elementwise_op_function.h @@ -365,10 +365,10 @@ template void ElementwiseComputeEx(const framework::ExecutionContext& ctx, const framework::Tensor* x, - const framework::Tensor* y, int axis, + const framework::Tensor* y, int axis, Functor func, framework::Tensor* z) { TransformFunctor functor( - x, y, z, ctx.template device_context(), Functor()); + x, y, z, ctx.template device_context(), func); auto x_dims = x->dims(); auto y_dims = y->dims(); diff --git a/paddle/operators/elementwise_pow_op.h b/paddle/operators/elementwise_pow_op.h index 874fd3f09f2..0c5dd031ec4 100644 --- a/paddle/operators/elementwise_pow_op.h +++ b/paddle/operators/elementwise_pow_op.h @@ -36,7 +36,8 @@ class ElementwisePowKernel : public framework::OpKernel { auto* z = ctx.Output("Out"); z->mutable_data(ctx.GetPlace()); int axis = ctx.Attr("axis"); - ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, z); + ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, + PowFunctor(), z); } }; diff --git a/paddle/operators/elementwise_sub_op.h b/paddle/operators/elementwise_sub_op.h index c2749a8e6ba..6a88c5f6b4c 100644 --- a/paddle/operators/elementwise_sub_op.h +++ b/paddle/operators/elementwise_sub_op.h @@ -34,7 +34,8 @@ class ElementwiseSubKernel : public framework::OpKernel { auto* z = ctx.Output("Out"); z->mutable_data(ctx.GetPlace()); int axis = ctx.Attr("axis"); - ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, z); + ElementwiseComputeEx, DeviceContext, T>(ctx, x, y, axis, + SubFunctor(), z); } }; diff --git a/paddle/operators/layer_norm_op.cc b/paddle/operators/layer_norm_op.cc index 8fcac00e08f..6dd18277c9c 100644 --- a/paddle/operators/layer_norm_op.cc +++ b/paddle/operators/layer_norm_op.cc @@ -13,6 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "paddle/operators/layer_norm_op.h" +#include "paddle/operators/elementwise_op_function.h" +#include "paddle/operators/math/math_function.h" namespace paddle { namespace operators { @@ -353,8 +355,9 @@ namespace ops = paddle::operators; REGISTER_OP(layer_norm, ops::LayerNormOp, ops::LayerNormOpMaker, layer_norm_grad, ops::LayerNormGradOp); REGISTER_OP_CPU_KERNEL( - layer_norm, - ops::LayerNormKernel); + layer_norm, ops::LayerNormKernel, + ops::LayerNormKernel); REGISTER_OP_CPU_KERNEL( layer_norm_grad, - ops::LayerNormGradKernel); + ops::LayerNormGradKernel, + ops::LayerNormGradKernel); diff --git a/paddle/operators/layer_norm_op.cu b/paddle/operators/layer_norm_op.cu new file mode 100644 index 00000000000..a84f5a41eae --- /dev/null +++ b/paddle/operators/layer_norm_op.cu @@ -0,0 +1,245 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include "paddle/operators/elementwise_op_function.h" +#include "paddle/operators/layer_norm_op.h" +#include "paddle/operators/math/math_function.h" + +namespace paddle { +namespace operators { + +using Tensor = framework::Tensor; +using LoDTensor = framework::LoDTensor; +using DataLayout = framework::DataLayout; + +namespace { +template +struct SubAndSquareFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return (a - b) * (a - b); } +}; + +template +struct DivAndSqrtFunctor { + explicit DivAndSqrtFunctor(T epsilon) { epsilon_ = epsilon; } + inline HOSTDEVICE T operator()(T a, T b) const { + return a / (sqrt(b) + epsilon_); + } + + private: + T epsilon_; +}; + +template +struct MulFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return a * b; } +}; + +template +struct AddFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return a + b; } +}; + +template +struct SubFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return a - b; } +}; + +template +struct MulInvVarFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { + return a * std::sqrt(1.0 / b); + } +}; +} // namespace + +template +class LayerNormCUDAKernel : public framework::OpKernel { + public: + void Compute(const framework::ExecutionContext &ctx) const override { + const float epsilon = ctx.Attr("epsilon"); + auto *scale = ctx.Input("Scale"); + auto *bias = ctx.Input("Bias"); + auto x = *ctx.Input("X"); + + auto *y = ctx.Output("Y"); + auto *mean = ctx.Output("Mean"); + auto *var = ctx.Output("Variance"); + const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); + + const auto &x_dims = x.dims(); + + y->mutable_data(ctx.GetPlace()); + mean->mutable_data(ctx.GetPlace()); + var->mutable_data(ctx.GetPlace()); + + auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); + int left = static_cast(matrix_dim[0]); + int right = static_cast(matrix_dim[1]); + + framework::DDim matrix_shape({left, right}); + + x.Resize(matrix_shape); + y->Resize(matrix_shape); + + auto &dev_ctx = ctx.template device_context(); + math::RowwiseMean row_mean; + + // functor-> get mean + row_mean(dev_ctx, x, mean); + + // functor-> get variance + ElementwiseComputeEx, DeviceContext, T>( + ctx, &x, mean, /*axis*/ 0, SubAndSquareFunctor(), y); + row_mean(dev_ctx, *y, var); + + // functor-> get norm_out + ElementwiseComputeEx, DeviceContext, T>( + ctx, &x, mean, /*axis*/ 0, SubFunctor(), y); + ElementwiseComputeEx, DeviceContext, T>( + ctx, y, var, /*axis*/ 0, DivAndSqrtFunctor(static_cast(epsilon)), + y); + + framework::DDim scale_shape({right}); + if (scale) { + Tensor scale_matrix = *scale; + scale_matrix.Resize(scale_shape); + ElementwiseComputeEx, DeviceContext, T>( + ctx, y, &scale_matrix, /*axis*/ 1, MulFunctor(), y); + } + if (bias) { + Tensor bias_matrix = *bias; + bias_matrix.Resize(scale_shape); + ElementwiseComputeEx, DeviceContext, T>( + ctx, y, &bias_matrix, /*axis*/ 1, AddFunctor(), y); + } + y->Resize(x_dims); + } +}; + +template +class LayerNormCUDAGradKernel : public framework::OpKernel { + public: + void Compute(const framework::ExecutionContext &ctx) const override { + const float epsilon = ctx.Attr("epsilon"); + auto x = *ctx.Input("X"); + auto mean = *ctx.Input("Mean"); + auto var = *ctx.Input("Variance"); + auto scale = *ctx.Input("Scale"); + auto d_y = *ctx.Input(framework::GradVarName("Y")); + const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); + + // init output + auto *d_x = ctx.Output(framework::GradVarName("X")); + auto *d_scale = ctx.Output(framework::GradVarName("Scale")); + auto *d_bias = ctx.Output(framework::GradVarName("Bias")); + + const auto &x_dims = x.dims(); + auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); + int left = static_cast(matrix_dim[0]); + int right = static_cast(matrix_dim[1]); + framework::DDim matrix_shape({left, right}); + + d_y.Resize(matrix_shape); + auto &dev_ctx = ctx.template device_context(); + math::ColwiseSum colwise_sum; + + Tensor temp; + Tensor temp_norm; + if (d_scale || d_x) { + x.Resize(matrix_shape); + temp.mutable_data(matrix_shape, ctx.GetPlace()); + temp_norm.mutable_data(matrix_shape, ctx.GetPlace()); + + // get x_norm + ElementwiseComputeEx, DeviceContext, T>( + ctx, &x, &mean, /*axis*/ 0, SubFunctor(), &temp_norm); + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp_norm, &var, /*axis*/ 0, + DivAndSqrtFunctor(static_cast(epsilon)), &temp_norm); + } + + if (d_bias) { + d_bias->mutable_data(ctx.GetPlace()); + colwise_sum(dev_ctx, d_y, d_bias); + } + if (d_scale) { + d_scale->mutable_data(ctx.GetPlace()); + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp_norm, &d_y, /*axis*/ 0, MulFunctor(), &temp); + colwise_sum(dev_ctx, temp, d_scale); + } + + if (d_x) { + framework::DDim vec_shape({left}); + d_x->mutable_data(ctx.GetPlace()); + Tensor temp_vec; + temp_vec.mutable_data(vec_shape, ctx.GetPlace()); + + auto &dev_ctx = ctx.template device_context(); + math::RowwiseMean row_mean; + + if (d_scale) { + // dy_dx + ElementwiseComputeEx, DeviceContext, T>( + ctx, &d_y, &scale, /*axis*/ 1, MulFunctor(), &temp); + framework::Copy(temp, ctx.GetPlace(), ctx.device_context(), d_x); + + // dy_dmean_dx + row_mean(dev_ctx, temp, &temp_vec); + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &temp_vec, /*axis*/ 0, SubFunctor(), d_x); + + // dy_var_dx + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp, &temp_norm, /*axis*/ 0, MulFunctor(), &temp); + + } else { + // dy_dx + framework::Copy(d_y, ctx.GetPlace(), ctx.device_context(), d_x); + + // dy_dmean_dx + row_mean(dev_ctx, d_y, &temp_vec); + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &temp_vec, /*axis*/ 0, SubFunctor(), d_x); + + // dy_var_dx + ElementwiseComputeEx, DeviceContext, T>( + ctx, &d_y, &temp_norm, /*axis*/ 0, MulFunctor(), &temp); + } + // dy_var_dx + row_mean(dev_ctx, temp, &temp_vec); + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp_norm, &temp_vec, /*axis*/ 0, MulFunctor(), &temp_norm); + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &temp_norm, /*axis*/ 0, SubFunctor(), d_x); + + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &var, /*axis*/ 0, + DivAndSqrtFunctor(static_cast(epsilon)), d_x); + } + } +}; + +} // namespace operators +} // namespace paddle + +namespace ops = paddle::operators; +REGISTER_OP_CUDA_KERNEL( + layer_norm, + ops::LayerNormCUDAKernel, + ops::LayerNormCUDAKernel); +REGISTER_OP_CUDA_KERNEL( + layer_norm_grad, + ops::LayerNormCUDAGradKernel, + ops::LayerNormCUDAGradKernel); diff --git a/paddle/operators/math/math_function.cc b/paddle/operators/math/math_function.cc index dcf4b85e1aa..ce0a5f6cff8 100644 --- a/paddle/operators/math/math_function.cc +++ b/paddle/operators/math/math_function.cc @@ -331,6 +331,12 @@ template struct RowwiseAdd; template struct ColwiseSum; template struct ColwiseSum; +template struct RowwiseSum; +template struct RowwiseSum; + +template struct RowwiseMean; +template struct RowwiseMean; + } // namespace math } // namespace operators } // namespace paddle diff --git a/paddle/operators/math/math_function.cu b/paddle/operators/math/math_function.cu index d47a7f818de..c0a107470a4 100644 --- a/paddle/operators/math/math_function.cu +++ b/paddle/operators/math/math_function.cu @@ -325,6 +325,31 @@ void ColwiseSum::operator()( vector->data()); } +template struct RowwiseSum; +// template struct RowwiseSum; +// TODO(zcd): Following ColwiseSum format, need to confirm. +// The RowwiseSum failed in debug mode, +// and only failed for this case. So reimplemented it. +template <> +void RowwiseSum::operator()( + const platform::CUDADeviceContext& context, const framework::Tensor& input, + framework::Tensor* vector) { + auto in_dims = input.dims(); + auto size = input.numel() / in_dims[0]; + PADDLE_ENFORCE_EQ(vector->numel(), in_dims[0]); + framework::Tensor one; + one.mutable_data({size}, context.GetPlace()); + SetConstant set; + set(context, &one, static_cast(1.0)); + gemv( + context, true, static_cast(in_dims[1]), static_cast(in_dims[0]), + 1.0, one.data(), input.data(), 0.0, + vector->data()); +} + +template struct RowwiseMean; +template struct RowwiseMean; + } // namespace math } // namespace operators } // namespace paddle diff --git a/paddle/operators/math/math_function.h b/paddle/operators/math/math_function.h index 8cc03c2ba0f..cb14d1e5746 100644 --- a/paddle/operators/math/math_function.h +++ b/paddle/operators/math/math_function.h @@ -128,6 +128,18 @@ struct ColwiseSum { framework::Tensor* vec); }; +template +struct RowwiseSum { + void operator()(const DeviceContext& context, const framework::Tensor& input, + framework::Tensor* vec); +}; + +template +struct RowwiseMean { + void operator()(const DeviceContext& context, const framework::Tensor& input, + framework::Tensor* vec); +}; + } // namespace math } // namespace operators } // namespace paddle diff --git a/paddle/operators/math/math_function_impl.h b/paddle/operators/math/math_function_impl.h index de591626df2..af4127788af 100644 --- a/paddle/operators/math/math_function_impl.h +++ b/paddle/operators/math/math_function_impl.h @@ -87,6 +87,88 @@ class ColwiseSum { } }; +template +void RowwiseMean::operator()(const DeviceContext& context, + const framework::Tensor& input, + framework::Tensor* out) { + auto in_dims = input.dims(); + PADDLE_ENFORCE_EQ(in_dims.size(), 2U); + PADDLE_ENFORCE_EQ(out->numel(), in_dims[0]); + + auto in = framework::EigenMatrix::From(input); + auto vec = framework::EigenVector::Flatten(*out); + + vec.device(*context.eigen_device()) = in.mean(Eigen::array({{1}})); +} +// TODO(zcd): Following ColwiseSum format, need to confirm. +// Specialize for CPU, since Eigen implement a general reduce. However, +// rowwise-sum can be easily implemented. General reduce has a huge overhead in +// CPU +template +class RowwiseMean { + public: + void operator()(const platform::CPUDeviceContext& context, + const framework::Tensor& input, framework::Tensor* out) { + auto& in_dims = input.dims(); + PADDLE_ENFORCE_EQ(in_dims.size(), 2U); + auto height = in_dims[0]; + auto size = in_dims[1]; + PADDLE_ENFORCE_EQ(out->numel(), height); + auto inv_size = 1.0 / size; + T* out_buf = out->mutable_data(out->place()); + const T* in_buf = input.data(); + + for (size_t i = 0; i < static_cast(height); ++i) { + T sum = 0; + for (size_t j = 0; j < static_cast(size); ++j) { + sum += in_buf[i * size + j]; + } + out_buf[i] = sum * inv_size; + } + } +}; + +template +void RowwiseSum::operator()(const DeviceContext& context, + const framework::Tensor& input, + framework::Tensor* out) { + auto in_dims = input.dims(); + PADDLE_ENFORCE_EQ(in_dims.size(), 2U); + PADDLE_ENFORCE_EQ(out->numel(), in_dims[0]); + + auto in = framework::EigenMatrix::From(input); + auto vec = framework::EigenVector::Flatten(*out); + + vec.device(*context.eigen_device()) = in.sum(Eigen::array({{1}})); +} +// TODO(zcd): Following ColwiseSum format, need to confirm. +// Specialize for CPU, since Eigen implement a general reduce. However, +// rowwise-sum can be easily implemented. General reduce has a huge overhead in +// CPU +template +class RowwiseSum { + public: + void operator()(const platform::CPUDeviceContext& context, + const framework::Tensor& input, framework::Tensor* out) { + auto& in_dims = input.dims(); + PADDLE_ENFORCE_EQ(in_dims.size(), 2U); + auto height = in_dims[0]; + auto size = in_dims[1]; + PADDLE_ENFORCE_EQ(out->numel(), size); + + T* out_buf = out->mutable_data(out->place()); + const T* in_buf = input.data(); + + for (size_t i = 0; i < static_cast(height); ++i) { + T sum = 0; + for (size_t j = 0; j < static_cast(size); ++j) { + sum += in_buf[i * size + j]; + } + out_buf[i] = sum; + } + } +}; + } // namespace math } // namespace operators } // namespace paddle -- GitLab From e03337350356626f36cdff371a3e82292e25a1c8 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Sat, 3 Feb 2018 14:34:29 +0800 Subject: [PATCH 04/55] unifid GPU and CPU implementation --- paddle/operators/layer_norm_op.cc | 187 ------------------------ paddle/operators/layer_norm_op.cu | 228 +----------------------------- paddle/operators/layer_norm_op.h | 204 +++++++++++++++++++++++++- 3 files changed, 206 insertions(+), 413 deletions(-) diff --git a/paddle/operators/layer_norm_op.cc b/paddle/operators/layer_norm_op.cc index 6dd18277c9c..edc26dfb96f 100644 --- a/paddle/operators/layer_norm_op.cc +++ b/paddle/operators/layer_norm_op.cc @@ -13,8 +13,6 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "paddle/operators/layer_norm_op.h" -#include "paddle/operators/elementwise_op_function.h" -#include "paddle/operators/math/math_function.h" namespace paddle { namespace operators { @@ -23,13 +21,6 @@ using Tensor = framework::Tensor; using LoDTensor = framework::LoDTensor; using DataLayout = framework::DataLayout; -template -using EigenMatrixMapRowMajor = Eigen::Map< - Eigen::Matrix>; -template -using ConstEigenMatrixMapRowMajor = Eigen::Map< - const Eigen::Matrix>; - class LayerNormOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; @@ -118,75 +109,6 @@ https://arxiv.org/abs/1607.06450 } }; -template -class LayerNormKernel - : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext &ctx) const override { - const float epsilon = ctx.Attr("epsilon"); - const auto *scale = ctx.Input("Scale"); - const auto *bias = ctx.Input("Bias"); - const auto *x = ctx.Input("X"); - const auto &x_dims = x->dims(); - const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); - - auto *output = ctx.Output("Y"); - auto *mean = ctx.Output("Mean"); - auto *var = ctx.Output("Variance"); - output->mutable_data(ctx.GetPlace()); - mean->mutable_data(ctx.GetPlace()); - var->mutable_data(ctx.GetPlace()); - - auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); - int left = static_cast(matrix_dim[0]); - int right = static_cast(matrix_dim[1]); - - auto input_map = ConstEigenMatrixMapRowMajor(x->data(), left, right); - - auto mean_map = EigenMatrixMapRowMajor(mean->data(), left, 1); - auto var_map = EigenMatrixMapRowMajor(var->data(), left, 1); - auto output_map = EigenMatrixMapRowMajor(output->data(), left, right); - - auto squre = [](T ele) { return ele * ele; }; - auto add_epslion = [epsilon](T ele) { return ele + epsilon; }; - - mean_map = input_map.rowwise().mean(); - var_map = (input_map - mean_map.replicate(1, right)) - .unaryExpr(squre) - .rowwise() - .mean() - .unaryExpr(add_epslion); - - auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; - // TODO(zcd): Some thinking about output_map, is it appropriate that - // `output_map` and `input_map` point to the same memory. - auto inv_std = var_map.unaryExpr(inv_std_func); - if (scale && bias) { - auto scale_map = - ConstEigenMatrixMapRowMajor(scale->data(), 1, right); - auto bias_map = ConstEigenMatrixMapRowMajor(bias->data(), 1, right); - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)) - .cwiseProduct(scale_map.replicate(left, 1)) + - bias_map.replicate(left, 1); - } else if (scale) { - auto scale_map = - ConstEigenMatrixMapRowMajor(scale->data(), 1, right); - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)) - .cwiseProduct(scale_map.replicate(left, 1)); - } else if (bias) { - auto bias_map = ConstEigenMatrixMapRowMajor(bias->data(), 1, right); - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)) + - bias_map.replicate(left, 1); - } else { - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)); - } - } -}; - class LayerNormGradOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; @@ -239,115 +161,6 @@ class LayerNormGradOp : public framework::OperatorWithKernel { } }; -template -class LayerNormGradKernel - : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext &ctx) const override { - const auto *x = ctx.Input("X"); - const auto *mean = ctx.Input("Mean"); - const auto *var = ctx.Input("Variance"); - const auto *scale = ctx.Input("Scale"); - const auto *d_y = ctx.Input(framework::GradVarName("Y")); - - const auto &x_dims = x->dims(); - - const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); - auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); - int left = static_cast(matrix_dim[0]); - int right = static_cast(matrix_dim[1]); - - // init output - auto *d_x = ctx.Output(framework::GradVarName("X")); - auto *d_scale = ctx.Output(framework::GradVarName("Scale")); - auto *d_bias = ctx.Output(framework::GradVarName("Bias")); - - auto x_map = ConstEigenMatrixMapRowMajor(x->data(), left, right); - auto d_y_map = ConstEigenMatrixMapRowMajor(d_y->data(), left, right); - auto mean_map = ConstEigenMatrixMapRowMajor(mean->data(), left, 1); - auto var_map = ConstEigenMatrixMapRowMajor(var->data(), left, 1); - - if (d_bias) { - d_bias->mutable_data(ctx.GetPlace()); - auto d_bias_map = EigenMatrixMapRowMajor(d_bias->data(), 1, right); - d_bias_map = d_y_map.colwise().sum(); - } - if (d_scale) { - d_scale->mutable_data(ctx.GetPlace()); - auto d_scale_map = - EigenMatrixMapRowMajor(d_scale->data(), 1, right); - auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; - // There are two equation to compute d_scale. One uses "Y" and the other - // does not use "Y" - d_scale_map = - ((x_map - mean_map.replicate(1, right)) - .cwiseProduct( - var_map.unaryExpr(inv_std_func).replicate(1, right)) - .cwiseProduct(d_y_map)) - .colwise() - .sum(); - } - - if (d_x) { - d_x->mutable_data(ctx.GetPlace()); - auto d_x_map = EigenMatrixMapRowMajor(d_x->data(), left, right); - auto triple_product_func = [](T ele) { return ele * ele * ele; }; - auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; - - auto inv_std_map = var_map.unaryExpr(inv_std_func).eval(); - // TODO(zcd): these code can be refined - if (d_scale) { - auto scale_map = - ConstEigenMatrixMapRowMajor(scale->data(), 1, right); - // dy_dx - auto dx_end = - inv_std_map.replicate(1, right).cwiseProduct(d_y_map).cwiseProduct( - scale_map.replicate(left, 1)); - - // dy_dmean_dx - auto dx_mean = - (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); - - // dy_var_dx - auto dvar_end_part = (x_map - mean_map.replicate(1, right)) - .cwiseProduct(scale_map.replicate(left, 1)) - .cwiseProduct(d_y_map) - .rowwise() - .sum(); - auto dvar_end = inv_std_map.unaryExpr(triple_product_func) - .cwiseProduct(dvar_end_part) - .replicate(1, right); - auto dx_var = - (T(-1.0) / right) * - (x_map - mean_map.replicate(1, right)).cwiseProduct(dvar_end); - - d_x_map = dx_end + dx_mean + dx_var; - } else { - // dy_dx - auto dx_end = inv_std_map.replicate(1, right).cwiseProduct(d_y_map); - - // dy_dmean_dx - auto dx_mean = - (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); - - // dy_var_dx - auto dvar_end_part = (x_map - mean_map.replicate(1, right)) - .cwiseProduct(d_y_map) - .rowwise() - .sum(); - auto dvar_end = inv_std_map.unaryExpr(triple_product_func) - .cwiseProduct(dvar_end_part) - .replicate(1, right); - auto dx_var = - (T(-1.0) / right) * - (x_map - mean_map.replicate(1, right)).cwiseProduct(dvar_end); - - d_x_map = dx_end + dx_mean + dx_var; - } - } - } -}; - } // namespace operators } // namespace paddle diff --git a/paddle/operators/layer_norm_op.cu b/paddle/operators/layer_norm_op.cu index a84f5a41eae..77d13b216f0 100644 --- a/paddle/operators/layer_norm_op.cu +++ b/paddle/operators/layer_norm_op.cu @@ -12,234 +12,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_op_function.h" #include "paddle/operators/layer_norm_op.h" -#include "paddle/operators/math/math_function.h" - -namespace paddle { -namespace operators { - -using Tensor = framework::Tensor; -using LoDTensor = framework::LoDTensor; -using DataLayout = framework::DataLayout; - -namespace { -template -struct SubAndSquareFunctor { - inline HOSTDEVICE T operator()(T a, T b) const { return (a - b) * (a - b); } -}; - -template -struct DivAndSqrtFunctor { - explicit DivAndSqrtFunctor(T epsilon) { epsilon_ = epsilon; } - inline HOSTDEVICE T operator()(T a, T b) const { - return a / (sqrt(b) + epsilon_); - } - - private: - T epsilon_; -}; - -template -struct MulFunctor { - inline HOSTDEVICE T operator()(T a, T b) const { return a * b; } -}; - -template -struct AddFunctor { - inline HOSTDEVICE T operator()(T a, T b) const { return a + b; } -}; - -template -struct SubFunctor { - inline HOSTDEVICE T operator()(T a, T b) const { return a - b; } -}; - -template -struct MulInvVarFunctor { - inline HOSTDEVICE T operator()(T a, T b) const { - return a * std::sqrt(1.0 / b); - } -}; -} // namespace - -template -class LayerNormCUDAKernel : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext &ctx) const override { - const float epsilon = ctx.Attr("epsilon"); - auto *scale = ctx.Input("Scale"); - auto *bias = ctx.Input("Bias"); - auto x = *ctx.Input("X"); - - auto *y = ctx.Output("Y"); - auto *mean = ctx.Output("Mean"); - auto *var = ctx.Output("Variance"); - const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); - - const auto &x_dims = x.dims(); - - y->mutable_data(ctx.GetPlace()); - mean->mutable_data(ctx.GetPlace()); - var->mutable_data(ctx.GetPlace()); - - auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); - int left = static_cast(matrix_dim[0]); - int right = static_cast(matrix_dim[1]); - - framework::DDim matrix_shape({left, right}); - - x.Resize(matrix_shape); - y->Resize(matrix_shape); - - auto &dev_ctx = ctx.template device_context(); - math::RowwiseMean row_mean; - - // functor-> get mean - row_mean(dev_ctx, x, mean); - - // functor-> get variance - ElementwiseComputeEx, DeviceContext, T>( - ctx, &x, mean, /*axis*/ 0, SubAndSquareFunctor(), y); - row_mean(dev_ctx, *y, var); - - // functor-> get norm_out - ElementwiseComputeEx, DeviceContext, T>( - ctx, &x, mean, /*axis*/ 0, SubFunctor(), y); - ElementwiseComputeEx, DeviceContext, T>( - ctx, y, var, /*axis*/ 0, DivAndSqrtFunctor(static_cast(epsilon)), - y); - - framework::DDim scale_shape({right}); - if (scale) { - Tensor scale_matrix = *scale; - scale_matrix.Resize(scale_shape); - ElementwiseComputeEx, DeviceContext, T>( - ctx, y, &scale_matrix, /*axis*/ 1, MulFunctor(), y); - } - if (bias) { - Tensor bias_matrix = *bias; - bias_matrix.Resize(scale_shape); - ElementwiseComputeEx, DeviceContext, T>( - ctx, y, &bias_matrix, /*axis*/ 1, AddFunctor(), y); - } - y->Resize(x_dims); - } -}; - -template -class LayerNormCUDAGradKernel : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext &ctx) const override { - const float epsilon = ctx.Attr("epsilon"); - auto x = *ctx.Input("X"); - auto mean = *ctx.Input("Mean"); - auto var = *ctx.Input("Variance"); - auto scale = *ctx.Input("Scale"); - auto d_y = *ctx.Input(framework::GradVarName("Y")); - const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); - - // init output - auto *d_x = ctx.Output(framework::GradVarName("X")); - auto *d_scale = ctx.Output(framework::GradVarName("Scale")); - auto *d_bias = ctx.Output(framework::GradVarName("Bias")); - - const auto &x_dims = x.dims(); - auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); - int left = static_cast(matrix_dim[0]); - int right = static_cast(matrix_dim[1]); - framework::DDim matrix_shape({left, right}); - - d_y.Resize(matrix_shape); - auto &dev_ctx = ctx.template device_context(); - math::ColwiseSum colwise_sum; - - Tensor temp; - Tensor temp_norm; - if (d_scale || d_x) { - x.Resize(matrix_shape); - temp.mutable_data(matrix_shape, ctx.GetPlace()); - temp_norm.mutable_data(matrix_shape, ctx.GetPlace()); - - // get x_norm - ElementwiseComputeEx, DeviceContext, T>( - ctx, &x, &mean, /*axis*/ 0, SubFunctor(), &temp_norm); - ElementwiseComputeEx, DeviceContext, T>( - ctx, &temp_norm, &var, /*axis*/ 0, - DivAndSqrtFunctor(static_cast(epsilon)), &temp_norm); - } - - if (d_bias) { - d_bias->mutable_data(ctx.GetPlace()); - colwise_sum(dev_ctx, d_y, d_bias); - } - if (d_scale) { - d_scale->mutable_data(ctx.GetPlace()); - ElementwiseComputeEx, DeviceContext, T>( - ctx, &temp_norm, &d_y, /*axis*/ 0, MulFunctor(), &temp); - colwise_sum(dev_ctx, temp, d_scale); - } - - if (d_x) { - framework::DDim vec_shape({left}); - d_x->mutable_data(ctx.GetPlace()); - Tensor temp_vec; - temp_vec.mutable_data(vec_shape, ctx.GetPlace()); - - auto &dev_ctx = ctx.template device_context(); - math::RowwiseMean row_mean; - - if (d_scale) { - // dy_dx - ElementwiseComputeEx, DeviceContext, T>( - ctx, &d_y, &scale, /*axis*/ 1, MulFunctor(), &temp); - framework::Copy(temp, ctx.GetPlace(), ctx.device_context(), d_x); - - // dy_dmean_dx - row_mean(dev_ctx, temp, &temp_vec); - ElementwiseComputeEx, DeviceContext, T>( - ctx, d_x, &temp_vec, /*axis*/ 0, SubFunctor(), d_x); - - // dy_var_dx - ElementwiseComputeEx, DeviceContext, T>( - ctx, &temp, &temp_norm, /*axis*/ 0, MulFunctor(), &temp); - - } else { - // dy_dx - framework::Copy(d_y, ctx.GetPlace(), ctx.device_context(), d_x); - - // dy_dmean_dx - row_mean(dev_ctx, d_y, &temp_vec); - ElementwiseComputeEx, DeviceContext, T>( - ctx, d_x, &temp_vec, /*axis*/ 0, SubFunctor(), d_x); - - // dy_var_dx - ElementwiseComputeEx, DeviceContext, T>( - ctx, &d_y, &temp_norm, /*axis*/ 0, MulFunctor(), &temp); - } - // dy_var_dx - row_mean(dev_ctx, temp, &temp_vec); - ElementwiseComputeEx, DeviceContext, T>( - ctx, &temp_norm, &temp_vec, /*axis*/ 0, MulFunctor(), &temp_norm); - ElementwiseComputeEx, DeviceContext, T>( - ctx, d_x, &temp_norm, /*axis*/ 0, SubFunctor(), d_x); - - ElementwiseComputeEx, DeviceContext, T>( - ctx, d_x, &var, /*axis*/ 0, - DivAndSqrtFunctor(static_cast(epsilon)), d_x); - } - } -}; - -} // namespace operators -} // namespace paddle namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( layer_norm, - ops::LayerNormCUDAKernel, - ops::LayerNormCUDAKernel); + ops::LayerNormKernel, + ops::LayerNormKernel); REGISTER_OP_CUDA_KERNEL( layer_norm_grad, - ops::LayerNormCUDAGradKernel, - ops::LayerNormCUDAGradKernel); + ops::LayerNormGradKernel, + ops::LayerNormGradKernel); diff --git a/paddle/operators/layer_norm_op.h b/paddle/operators/layer_norm_op.h index bca35b91e6f..309f1b87a26 100644 --- a/paddle/operators/layer_norm_op.h +++ b/paddle/operators/layer_norm_op.h @@ -16,19 +16,219 @@ limitations under the License. */ #include "paddle/framework/eigen.h" #include "paddle/framework/op_registry.h" +#include "paddle/operators/elementwise_op_function.h" +#include "paddle/operators/math/math_function.h" + namespace paddle { namespace operators { +template +struct SubAndSquareFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return (a - b) * (a - b); } +}; + +template +struct DivAndSqrtFunctor { + explicit DivAndSqrtFunctor(T epsilon) { epsilon_ = epsilon; } + inline HOSTDEVICE T operator()(T a, T b) const { + return a / (sqrt(b) + epsilon_); + } + + private: + T epsilon_; +}; + +template +struct MulFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return a * b; } +}; + +template +struct AddFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return a + b; } +}; + +template +struct SubFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { return a - b; } +}; + +template +struct MulInvVarFunctor { + inline HOSTDEVICE T operator()(T a, T b) const { + return a * std::sqrt(1.0 / b); + } +}; + +using Tensor = framework::Tensor; +using LoDTensor = framework::LoDTensor; +using DataLayout = framework::DataLayout; + template class LayerNormKernel : public framework::OpKernel { public: - void Compute(const framework::ExecutionContext& ctx) const override; + void Compute(const framework::ExecutionContext &ctx) const override { + const float epsilon = ctx.Attr("epsilon"); + auto *scale = ctx.Input("Scale"); + auto *bias = ctx.Input("Bias"); + auto x = *ctx.Input("X"); + + auto *y = ctx.Output("Y"); + auto *mean = ctx.Output("Mean"); + auto *var = ctx.Output("Variance"); + const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); + + const auto &x_dims = x.dims(); + + y->mutable_data(ctx.GetPlace()); + mean->mutable_data(ctx.GetPlace()); + var->mutable_data(ctx.GetPlace()); + + auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); + int left = static_cast(matrix_dim[0]); + int right = static_cast(matrix_dim[1]); + + framework::DDim matrix_shape({left, right}); + + x.Resize(matrix_shape); + y->Resize(matrix_shape); + + auto &dev_ctx = ctx.template device_context(); + math::RowwiseMean row_mean; + + // functor-> get mean + row_mean(dev_ctx, x, mean); + + // functor-> get variance + ElementwiseComputeEx, DeviceContext, T>( + ctx, &x, mean, /*axis*/ 0, SubAndSquareFunctor(), y); + row_mean(dev_ctx, *y, var); + + // functor-> get norm_out + ElementwiseComputeEx, DeviceContext, T>( + ctx, &x, mean, /*axis*/ 0, SubFunctor(), y); + ElementwiseComputeEx, DeviceContext, T>( + ctx, y, var, /*axis*/ 0, DivAndSqrtFunctor(static_cast(epsilon)), + y); + + framework::DDim scale_shape({right}); + if (scale) { + Tensor scale_matrix = *scale; + scale_matrix.Resize(scale_shape); + ElementwiseComputeEx, DeviceContext, T>( + ctx, y, &scale_matrix, /*axis*/ 1, MulFunctor(), y); + } + if (bias) { + Tensor bias_matrix = *bias; + bias_matrix.Resize(scale_shape); + ElementwiseComputeEx, DeviceContext, T>( + ctx, y, &bias_matrix, /*axis*/ 1, AddFunctor(), y); + } + y->Resize(x_dims); + } }; template class LayerNormGradKernel : public framework::OpKernel { public: - void Compute(const framework::ExecutionContext& ctx) const override; + void Compute(const framework::ExecutionContext &ctx) const override { + const float epsilon = ctx.Attr("epsilon"); + auto x = *ctx.Input("X"); + auto mean = *ctx.Input("Mean"); + auto var = *ctx.Input("Variance"); + auto scale = *ctx.Input("Scale"); + auto d_y = *ctx.Input(framework::GradVarName("Y")); + const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); + + // init output + auto *d_x = ctx.Output(framework::GradVarName("X")); + auto *d_scale = ctx.Output(framework::GradVarName("Scale")); + auto *d_bias = ctx.Output(framework::GradVarName("Bias")); + + const auto &x_dims = x.dims(); + auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); + int left = static_cast(matrix_dim[0]); + int right = static_cast(matrix_dim[1]); + framework::DDim matrix_shape({left, right}); + + d_y.Resize(matrix_shape); + auto &dev_ctx = ctx.template device_context(); + math::ColwiseSum colwise_sum; + + Tensor temp; + Tensor temp_norm; + if (d_scale || d_x) { + x.Resize(matrix_shape); + temp.mutable_data(matrix_shape, ctx.GetPlace()); + temp_norm.mutable_data(matrix_shape, ctx.GetPlace()); + + // get x_norm + ElementwiseComputeEx, DeviceContext, T>( + ctx, &x, &mean, /*axis*/ 0, SubFunctor(), &temp_norm); + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp_norm, &var, /*axis*/ 0, + DivAndSqrtFunctor(static_cast(epsilon)), &temp_norm); + } + + if (d_bias) { + d_bias->mutable_data(ctx.GetPlace()); + colwise_sum(dev_ctx, d_y, d_bias); + } + if (d_scale) { + d_scale->mutable_data(ctx.GetPlace()); + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp_norm, &d_y, /*axis*/ 0, MulFunctor(), &temp); + colwise_sum(dev_ctx, temp, d_scale); + } + + if (d_x) { + framework::DDim vec_shape({left}); + d_x->mutable_data(ctx.GetPlace()); + Tensor temp_vec; + temp_vec.mutable_data(vec_shape, ctx.GetPlace()); + + math::RowwiseMean row_mean; + + if (d_scale) { + // dy_dx + ElementwiseComputeEx, DeviceContext, T>( + ctx, &d_y, &scale, /*axis*/ 1, MulFunctor(), &temp); + framework::Copy(temp, ctx.GetPlace(), ctx.device_context(), d_x); + + // dy_dmean_dx + row_mean(dev_ctx, temp, &temp_vec); + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &temp_vec, /*axis*/ 0, SubFunctor(), d_x); + + // dy_var_dx + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp, &temp_norm, /*axis*/ 0, MulFunctor(), &temp); + + } else { + // dy_dx + framework::Copy(d_y, ctx.GetPlace(), ctx.device_context(), d_x); + + // dy_dmean_dx + row_mean(dev_ctx, d_y, &temp_vec); + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &temp_vec, /*axis*/ 0, SubFunctor(), d_x); + + // dy_var_dx + ElementwiseComputeEx, DeviceContext, T>( + ctx, &d_y, &temp_norm, /*axis*/ 0, MulFunctor(), &temp); + } + // dy_var_dx + row_mean(dev_ctx, temp, &temp_vec); + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp_norm, &temp_vec, /*axis*/ 0, MulFunctor(), &temp_norm); + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &temp_norm, /*axis*/ 0, SubFunctor(), d_x); + + ElementwiseComputeEx, DeviceContext, T>( + ctx, d_x, &var, /*axis*/ 0, + DivAndSqrtFunctor(static_cast(epsilon)), d_x); + } + } }; } // namespace operators -- GitLab From c3d27b15b7575a48e02a24eae6dff6b58d23cf70 Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Sun, 4 Feb 2018 01:43:01 -0800 Subject: [PATCH 05/55] modify prune.cc for multiple blocks --- paddle/framework/prune.cc | 71 +++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/paddle/framework/prune.cc b/paddle/framework/prune.cc index bff8e0bceac..6a3882f199e 100644 --- a/paddle/framework/prune.cc +++ b/paddle/framework/prune.cc @@ -49,11 +49,28 @@ bool IsTarget(const proto::OpDesc& op_desc) { return false; } -void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, - int block_id) { - // TODO(tonyyang-svail): - // - will change to use multiple blocks for RNN op and Cond Op +int GetSubBlockIndex(const proto::OpDesc& op_desc) { + for (auto& attr : op_desc.attrs()) { + if (attr.type() == proto::AttrType::BLOCK) { + PADDLE_ENFORCE(attr.has_block_idx()); + return attr.block_idx(); + } + } + return -1; +} +bool HasSubBlock(const proto::OpDesc& op_desc) { + return GetSubBlockIndex(op_desc) > 0; +} + +// block_id is the idx of the current block in the input desc +// parent_block_id is the idx of the parent of the current block +// in the output desc, -1 means the current block is global block +// dependent_vars is passed recursively from the parent block to +// the child block to help pruning +void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, + int block_id, int parent_block_id, + std::set& dependent_vars) { auto& block = input.blocks(block_id); auto& ops = block.ops(); @@ -72,11 +89,9 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, expect_fetch = (op_desc.type() == kFetchOpType); } - std::set dependent_vars; std::vector should_run; for (auto op_iter = ops.rbegin(); op_iter != ops.rend(); ++op_iter) { auto& op_desc = *op_iter; - if (IsTarget(op_desc) || HasDependentVar(op_desc, dependent_vars)) { // insert its input to the dependency graph for (auto& var : op_desc.inputs()) { @@ -84,7 +99,6 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, dependent_vars.insert(argu); } } - should_run.push_back(true); } else { should_run.push_back(false); @@ -95,19 +109,48 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, // we reverse the should_run vector std::reverse(should_run.begin(), should_run.end()); - *output = input; - auto* op_field = output->mutable_blocks(block_id)->mutable_ops(); + //*output = input; + // copy the current block from input to output + auto* block_field = output->mutable_blocks(); + *block_field->Add() = input.blocks(block_id); + + int output_block_id = output->blocks_size() - 1; + auto* output_block = output->mutable_blocks(output_block_id); + output_block->set_idx = output_block_id; + output_block->set_parent_idx = parent_block_id; + + auto* op_field = output_block->mutable_ops(); op_field->Clear(); for (size_t i = 0; i < should_run.size(); ++i) { if (should_run[i]) { - *op_field->Add() = input.blocks(block_id).ops(i); + auto* op = op_field->Add(); + *op = input.blocks(block_id).ops(i); + if (HasSubBlock(*op)) { + // create sub_block_dependent_vars here to help prune the sub block + std::set sub_block_dependent_vars; + for (auto& var : op.inputs()) { + for (auto& argu : var.arguments()) { + sub_block_dependent_vars.insert(argu); + } + } + for (auto& var : op.outputs()) { + for (auto& argu : var.arguments()) { + sub_block_dependent_vars.insert(argu); + } + } + + // GetSubBlockIndex(*op) is the idx of the sub_block in the input desc + // output_block_id is the idx of the current block in the output desc + prune_impl(input, output, GetSubBlockIndex(*op), output_block_id, + sub_block_dependent_vars); + } } } // remove the VarDescs in BlockDesc that are not referenced in // the pruned OpDescs std::unordered_map var_map; - auto* var_field = output->mutable_blocks(block_id)->mutable_vars(); + auto* var_field = output->mutable_blocks(output_block_id)->mutable_vars(); for (const auto& var : *var_field) { var_map[var.name()] = var; } @@ -118,14 +161,14 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, auto& input_field = op.inputs(); for (auto& input_var : input_field) { for (auto& arg : input_var.arguments()) { - *var_field->Add() = var_map[arg]; + *var_field->Add() = var_map.at(arg); } } // add VarDescs of all output arguments for each OpDesc auto& output_field = op.outputs(); for (auto& output_var : output_field) { for (auto& arg : output_var.arguments()) { - *var_field->Add() = var_map[arg]; + *var_field->Add() = var_map.at(arg); } } } @@ -133,7 +176,7 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, // TODO(fengjiayi): Prune() could be inplaced to avoid unnecessary copies void Prune(const proto::ProgramDesc& input, proto::ProgramDesc* output) { - prune_impl(input, output, 0); + prune_impl(input, output, 0, -1, {}); } void inference_optimize_impl(const proto::ProgramDesc& input, -- GitLab From 5092f5291c17e46b4c5e176c00b46a69f5e0d466 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Sat, 3 Feb 2018 15:05:55 +0800 Subject: [PATCH 06/55] Separate GPU and CPU implementation --- paddle/operators/layer_norm_op.cc | 186 +++++++++++++++++- paddle/operators/layer_norm_op.h | 29 ++- .../v2/fluid/tests/test_layer_norm_op.py | 11 +- 3 files changed, 202 insertions(+), 24 deletions(-) diff --git a/paddle/operators/layer_norm_op.cc b/paddle/operators/layer_norm_op.cc index edc26dfb96f..910b8ec0a4d 100644 --- a/paddle/operators/layer_norm_op.cc +++ b/paddle/operators/layer_norm_op.cc @@ -21,6 +21,13 @@ using Tensor = framework::Tensor; using LoDTensor = framework::LoDTensor; using DataLayout = framework::DataLayout; +template +using EigenMatrixMapRowMajor = Eigen::Map< + Eigen::Matrix>; +template +using ConstEigenMatrixMapRowMajor = Eigen::Map< + const Eigen::Matrix>; + class LayerNormOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; @@ -101,7 +108,6 @@ class LayerNormOpMaker : public framework::OpProtoAndCheckerMaker { AddComment(R"DOC( Layer Normalization. - Layer Norm has been implemented as discussed in the paper: https://arxiv.org/abs/1607.06450 ... @@ -109,6 +115,75 @@ https://arxiv.org/abs/1607.06450 } }; +template +class LayerNormKernel + : public framework::OpKernel { + public: + void Compute(const framework::ExecutionContext &ctx) const override { + const float epsilon = ctx.Attr("epsilon"); + const auto *scale = ctx.Input("Scale"); + const auto *bias = ctx.Input("Bias"); + const auto *x = ctx.Input("X"); + const auto &x_dims = x->dims(); + const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); + + auto *output = ctx.Output("Y"); + auto *mean = ctx.Output("Mean"); + auto *var = ctx.Output("Variance"); + output->mutable_data(ctx.GetPlace()); + mean->mutable_data(ctx.GetPlace()); + var->mutable_data(ctx.GetPlace()); + + auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); + int left = static_cast(matrix_dim[0]); + int right = static_cast(matrix_dim[1]); + + auto input_map = ConstEigenMatrixMapRowMajor(x->data(), left, right); + + auto mean_map = EigenMatrixMapRowMajor(mean->data(), left, 1); + auto var_map = EigenMatrixMapRowMajor(var->data(), left, 1); + auto output_map = EigenMatrixMapRowMajor(output->data(), left, right); + + auto squre = [](T ele) { return ele * ele; }; + auto add_epslion = [epsilon](T ele) { return ele + epsilon; }; + + mean_map = input_map.rowwise().mean(); + var_map = (input_map - mean_map.replicate(1, right)) + .unaryExpr(squre) + .rowwise() + .mean() + .unaryExpr(add_epslion); + + auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; + // TODO(zcd): Some thinking about output_map, is it appropriate that + // `output_map` and `input_map` point to the same memory. + auto inv_std = var_map.unaryExpr(inv_std_func); + if (scale && bias) { + auto scale_map = + ConstEigenMatrixMapRowMajor(scale->data(), 1, right); + auto bias_map = ConstEigenMatrixMapRowMajor(bias->data(), 1, right); + output_map = (input_map - mean_map.replicate(1, right)) + .cwiseProduct(inv_std.replicate(1, right)) + .cwiseProduct(scale_map.replicate(left, 1)) + + bias_map.replicate(left, 1); + } else if (scale) { + auto scale_map = + ConstEigenMatrixMapRowMajor(scale->data(), 1, right); + output_map = (input_map - mean_map.replicate(1, right)) + .cwiseProduct(inv_std.replicate(1, right)) + .cwiseProduct(scale_map.replicate(left, 1)); + } else if (bias) { + auto bias_map = ConstEigenMatrixMapRowMajor(bias->data(), 1, right); + output_map = (input_map - mean_map.replicate(1, right)) + .cwiseProduct(inv_std.replicate(1, right)) + + bias_map.replicate(left, 1); + } else { + output_map = (input_map - mean_map.replicate(1, right)) + .cwiseProduct(inv_std.replicate(1, right)); + } + } +}; + class LayerNormGradOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; @@ -161,6 +236,115 @@ class LayerNormGradOp : public framework::OperatorWithKernel { } }; +template +class LayerNormGradKernel + : public framework::OpKernel { + public: + void Compute(const framework::ExecutionContext &ctx) const override { + const auto *x = ctx.Input("X"); + const auto *mean = ctx.Input("Mean"); + const auto *var = ctx.Input("Variance"); + const auto *scale = ctx.Input("Scale"); + const auto *d_y = ctx.Input(framework::GradVarName("Y")); + + const auto &x_dims = x->dims(); + + const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); + auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); + int left = static_cast(matrix_dim[0]); + int right = static_cast(matrix_dim[1]); + + // init output + auto *d_x = ctx.Output(framework::GradVarName("X")); + auto *d_scale = ctx.Output(framework::GradVarName("Scale")); + auto *d_bias = ctx.Output(framework::GradVarName("Bias")); + + auto x_map = ConstEigenMatrixMapRowMajor(x->data(), left, right); + auto d_y_map = ConstEigenMatrixMapRowMajor(d_y->data(), left, right); + auto mean_map = ConstEigenMatrixMapRowMajor(mean->data(), left, 1); + auto var_map = ConstEigenMatrixMapRowMajor(var->data(), left, 1); + + if (d_bias) { + d_bias->mutable_data(ctx.GetPlace()); + auto d_bias_map = EigenMatrixMapRowMajor(d_bias->data(), 1, right); + d_bias_map = d_y_map.colwise().sum(); + } + if (d_scale) { + d_scale->mutable_data(ctx.GetPlace()); + auto d_scale_map = + EigenMatrixMapRowMajor(d_scale->data(), 1, right); + auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; + // There are two equation to compute d_scale. One uses "Y" and the other + // does not use "Y" + d_scale_map = + ((x_map - mean_map.replicate(1, right)) + .cwiseProduct( + var_map.unaryExpr(inv_std_func).replicate(1, right)) + .cwiseProduct(d_y_map)) + .colwise() + .sum(); + } + + if (d_x) { + d_x->mutable_data(ctx.GetPlace()); + auto d_x_map = EigenMatrixMapRowMajor(d_x->data(), left, right); + auto triple_product_func = [](T ele) { return ele * ele * ele; }; + auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; + + auto inv_std_map = var_map.unaryExpr(inv_std_func).eval(); + // TODO(zcd): these code can be refined + if (d_scale) { + auto scale_map = + ConstEigenMatrixMapRowMajor(scale->data(), 1, right); + // dy_dx + auto dx_end = + inv_std_map.replicate(1, right).cwiseProduct(d_y_map).cwiseProduct( + scale_map.replicate(left, 1)); + + // dy_dmean_dx + auto dx_mean = + (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); + + // dy_var_dx + auto dvar_end_part = (x_map - mean_map.replicate(1, right)) + .cwiseProduct(scale_map.replicate(left, 1)) + .cwiseProduct(d_y_map) + .rowwise() + .sum(); + auto dvar_end = inv_std_map.unaryExpr(triple_product_func) + .cwiseProduct(dvar_end_part) + .replicate(1, right); + auto dx_var = + (T(-1.0) / right) * + (x_map - mean_map.replicate(1, right)).cwiseProduct(dvar_end); + + d_x_map = dx_end + dx_mean + dx_var; + } else { + // dy_dx + auto dx_end = inv_std_map.replicate(1, right).cwiseProduct(d_y_map); + + // dy_dmean_dx + auto dx_mean = + (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); + + // dy_var_dx + auto dvar_end_part = (x_map - mean_map.replicate(1, right)) + .cwiseProduct(d_y_map) + .rowwise() + .sum(); + auto dvar_end = inv_std_map.unaryExpr(triple_product_func) + .cwiseProduct(dvar_end_part) + .replicate(1, right); + auto dx_var = + (T(-1.0) / right) * + (x_map - mean_map.replicate(1, right)).cwiseProduct(dvar_end); + + d_x_map = dx_end + dx_mean + dx_var; + } + } + } +}; + } // namespace operators } // namespace paddle diff --git a/paddle/operators/layer_norm_op.h b/paddle/operators/layer_norm_op.h index 309f1b87a26..2de58186fbd 100644 --- a/paddle/operators/layer_norm_op.h +++ b/paddle/operators/layer_norm_op.h @@ -78,7 +78,7 @@ class LayerNormKernel : public framework::OpKernel { auto *var = ctx.Output("Variance"); const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); - const auto &x_dims = x.dims(); + const auto x_dims = x.dims(); y->mutable_data(ctx.GetPlace()); mean->mutable_data(ctx.GetPlace()); @@ -87,11 +87,12 @@ class LayerNormKernel : public framework::OpKernel { auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); int left = static_cast(matrix_dim[0]); int right = static_cast(matrix_dim[1]); - framework::DDim matrix_shape({left, right}); x.Resize(matrix_shape); - y->Resize(matrix_shape); + Tensor out; + out.ShareDataWith(*y); + out.Resize(matrix_shape); auto &dev_ctx = ctx.template device_context(); math::RowwiseMean row_mean; @@ -101,30 +102,24 @@ class LayerNormKernel : public framework::OpKernel { // functor-> get variance ElementwiseComputeEx, DeviceContext, T>( - ctx, &x, mean, /*axis*/ 0, SubAndSquareFunctor(), y); - row_mean(dev_ctx, *y, var); + ctx, &x, mean, /*axis*/ 0, SubAndSquareFunctor(), &out); + row_mean(dev_ctx, out, var); // functor-> get norm_out ElementwiseComputeEx, DeviceContext, T>( - ctx, &x, mean, /*axis*/ 0, SubFunctor(), y); + ctx, &x, mean, /*axis*/ 0, SubFunctor(), &out); ElementwiseComputeEx, DeviceContext, T>( - ctx, y, var, /*axis*/ 0, DivAndSqrtFunctor(static_cast(epsilon)), - y); + ctx, &out, var, /*axis*/ 0, + DivAndSqrtFunctor(static_cast(epsilon)), &out); - framework::DDim scale_shape({right}); if (scale) { - Tensor scale_matrix = *scale; - scale_matrix.Resize(scale_shape); ElementwiseComputeEx, DeviceContext, T>( - ctx, y, &scale_matrix, /*axis*/ 1, MulFunctor(), y); + ctx, &out, scale, /*axis*/ 1, MulFunctor(), &out); } if (bias) { - Tensor bias_matrix = *bias; - bias_matrix.Resize(scale_shape); ElementwiseComputeEx, DeviceContext, T>( - ctx, y, &bias_matrix, /*axis*/ 1, AddFunctor(), y); + ctx, &out, bias, /*axis*/ 1, AddFunctor(), &out); } - y->Resize(x_dims); } }; @@ -184,6 +179,7 @@ class LayerNormGradKernel : public framework::OpKernel { if (d_x) { framework::DDim vec_shape({left}); d_x->mutable_data(ctx.GetPlace()); + auto dx_dim = d_x->dims(); Tensor temp_vec; temp_vec.mutable_data(vec_shape, ctx.GetPlace()); @@ -227,6 +223,7 @@ class LayerNormGradKernel : public framework::OpKernel { ElementwiseComputeEx, DeviceContext, T>( ctx, d_x, &var, /*axis*/ 0, DivAndSqrtFunctor(static_cast(epsilon)), d_x); + d_x->Resize(dx_dim); } } }; diff --git a/python/paddle/v2/fluid/tests/test_layer_norm_op.py b/python/paddle/v2/fluid/tests/test_layer_norm_op.py index 68cf8673cd4..f456b1194c5 100644 --- a/python/paddle/v2/fluid/tests/test_layer_norm_op.py +++ b/python/paddle/v2/fluid/tests/test_layer_norm_op.py @@ -62,9 +62,9 @@ def _reference_layer_norm_grad(x, grad_y, scale, mean, var, begin_norm_axis=1): grad_x = dx_end + d_mean + d_std - grad_y.shape = x_shape - x.shape = x_shape + grad_x.shape, x.shape, grad_y.shape = x_shape, x_shape, x_shape scale.shape = scale_shape + var.shape, mean.shape = [N, ], [N, ] return grad_x, d_scale, d_bias @@ -112,10 +112,7 @@ def set_output_grad(scope, outputs, place, feed_dict=None): class TestLayerNormdOp(OpTest): def __assert_close(self, tensor, np_array, msg, atol=1e-4): - self.assertTrue( - np.allclose( - np.array(tensor).reshape(np_array.shape), np_array, atol=atol), - msg) + self.assertTrue(np.allclose(np.array(tensor), np_array, atol=atol), msg) def __assert_grad_close(self, tensor, @@ -123,7 +120,7 @@ class TestLayerNormdOp(OpTest): name, place, max_relative_error=0.02): - a = np.array(tensor).reshape(np_array.shape) + a = np.array(tensor) b = np_array abs_a = np.abs(a) abs_a[abs_a < 1e-5] = 1 -- GitLab From df0e74dba0fcbb894eeefa727d7a8a4d50025ccb Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Mon, 5 Feb 2018 11:28:22 +0800 Subject: [PATCH 07/55] unifid GPU and CPU implementation --- paddle/operators/layer_norm_op.cc | 185 ------------------ paddle/operators/layer_norm_op.h | 2 +- .../v2/fluid/tests/test_layer_norm_op.py | 4 +- 3 files changed, 4 insertions(+), 187 deletions(-) diff --git a/paddle/operators/layer_norm_op.cc b/paddle/operators/layer_norm_op.cc index 910b8ec0a4d..76d5d571c31 100644 --- a/paddle/operators/layer_norm_op.cc +++ b/paddle/operators/layer_norm_op.cc @@ -21,13 +21,6 @@ using Tensor = framework::Tensor; using LoDTensor = framework::LoDTensor; using DataLayout = framework::DataLayout; -template -using EigenMatrixMapRowMajor = Eigen::Map< - Eigen::Matrix>; -template -using ConstEigenMatrixMapRowMajor = Eigen::Map< - const Eigen::Matrix>; - class LayerNormOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; @@ -115,75 +108,6 @@ https://arxiv.org/abs/1607.06450 } }; -template -class LayerNormKernel - : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext &ctx) const override { - const float epsilon = ctx.Attr("epsilon"); - const auto *scale = ctx.Input("Scale"); - const auto *bias = ctx.Input("Bias"); - const auto *x = ctx.Input("X"); - const auto &x_dims = x->dims(); - const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); - - auto *output = ctx.Output("Y"); - auto *mean = ctx.Output("Mean"); - auto *var = ctx.Output("Variance"); - output->mutable_data(ctx.GetPlace()); - mean->mutable_data(ctx.GetPlace()); - var->mutable_data(ctx.GetPlace()); - - auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); - int left = static_cast(matrix_dim[0]); - int right = static_cast(matrix_dim[1]); - - auto input_map = ConstEigenMatrixMapRowMajor(x->data(), left, right); - - auto mean_map = EigenMatrixMapRowMajor(mean->data(), left, 1); - auto var_map = EigenMatrixMapRowMajor(var->data(), left, 1); - auto output_map = EigenMatrixMapRowMajor(output->data(), left, right); - - auto squre = [](T ele) { return ele * ele; }; - auto add_epslion = [epsilon](T ele) { return ele + epsilon; }; - - mean_map = input_map.rowwise().mean(); - var_map = (input_map - mean_map.replicate(1, right)) - .unaryExpr(squre) - .rowwise() - .mean() - .unaryExpr(add_epslion); - - auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; - // TODO(zcd): Some thinking about output_map, is it appropriate that - // `output_map` and `input_map` point to the same memory. - auto inv_std = var_map.unaryExpr(inv_std_func); - if (scale && bias) { - auto scale_map = - ConstEigenMatrixMapRowMajor(scale->data(), 1, right); - auto bias_map = ConstEigenMatrixMapRowMajor(bias->data(), 1, right); - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)) - .cwiseProduct(scale_map.replicate(left, 1)) + - bias_map.replicate(left, 1); - } else if (scale) { - auto scale_map = - ConstEigenMatrixMapRowMajor(scale->data(), 1, right); - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)) - .cwiseProduct(scale_map.replicate(left, 1)); - } else if (bias) { - auto bias_map = ConstEigenMatrixMapRowMajor(bias->data(), 1, right); - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)) + - bias_map.replicate(left, 1); - } else { - output_map = (input_map - mean_map.replicate(1, right)) - .cwiseProduct(inv_std.replicate(1, right)); - } - } -}; - class LayerNormGradOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; @@ -236,115 +160,6 @@ class LayerNormGradOp : public framework::OperatorWithKernel { } }; -template -class LayerNormGradKernel - : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext &ctx) const override { - const auto *x = ctx.Input("X"); - const auto *mean = ctx.Input("Mean"); - const auto *var = ctx.Input("Variance"); - const auto *scale = ctx.Input("Scale"); - const auto *d_y = ctx.Input(framework::GradVarName("Y")); - - const auto &x_dims = x->dims(); - - const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); - auto matrix_dim = framework::flatten_to_2d(x_dims, begin_norm_axis); - int left = static_cast(matrix_dim[0]); - int right = static_cast(matrix_dim[1]); - - // init output - auto *d_x = ctx.Output(framework::GradVarName("X")); - auto *d_scale = ctx.Output(framework::GradVarName("Scale")); - auto *d_bias = ctx.Output(framework::GradVarName("Bias")); - - auto x_map = ConstEigenMatrixMapRowMajor(x->data(), left, right); - auto d_y_map = ConstEigenMatrixMapRowMajor(d_y->data(), left, right); - auto mean_map = ConstEigenMatrixMapRowMajor(mean->data(), left, 1); - auto var_map = ConstEigenMatrixMapRowMajor(var->data(), left, 1); - - if (d_bias) { - d_bias->mutable_data(ctx.GetPlace()); - auto d_bias_map = EigenMatrixMapRowMajor(d_bias->data(), 1, right); - d_bias_map = d_y_map.colwise().sum(); - } - if (d_scale) { - d_scale->mutable_data(ctx.GetPlace()); - auto d_scale_map = - EigenMatrixMapRowMajor(d_scale->data(), 1, right); - auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; - // There are two equation to compute d_scale. One uses "Y" and the other - // does not use "Y" - d_scale_map = - ((x_map - mean_map.replicate(1, right)) - .cwiseProduct( - var_map.unaryExpr(inv_std_func).replicate(1, right)) - .cwiseProduct(d_y_map)) - .colwise() - .sum(); - } - - if (d_x) { - d_x->mutable_data(ctx.GetPlace()); - auto d_x_map = EigenMatrixMapRowMajor(d_x->data(), left, right); - auto triple_product_func = [](T ele) { return ele * ele * ele; }; - auto inv_std_func = [](T ele) { return std::sqrt(1 / ele); }; - - auto inv_std_map = var_map.unaryExpr(inv_std_func).eval(); - // TODO(zcd): these code can be refined - if (d_scale) { - auto scale_map = - ConstEigenMatrixMapRowMajor(scale->data(), 1, right); - // dy_dx - auto dx_end = - inv_std_map.replicate(1, right).cwiseProduct(d_y_map).cwiseProduct( - scale_map.replicate(left, 1)); - - // dy_dmean_dx - auto dx_mean = - (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); - - // dy_var_dx - auto dvar_end_part = (x_map - mean_map.replicate(1, right)) - .cwiseProduct(scale_map.replicate(left, 1)) - .cwiseProduct(d_y_map) - .rowwise() - .sum(); - auto dvar_end = inv_std_map.unaryExpr(triple_product_func) - .cwiseProduct(dvar_end_part) - .replicate(1, right); - auto dx_var = - (T(-1.0) / right) * - (x_map - mean_map.replicate(1, right)).cwiseProduct(dvar_end); - - d_x_map = dx_end + dx_mean + dx_var; - } else { - // dy_dx - auto dx_end = inv_std_map.replicate(1, right).cwiseProduct(d_y_map); - - // dy_dmean_dx - auto dx_mean = - (T(-1.0) / right) * dx_end.rowwise().sum().replicate(1, right); - - // dy_var_dx - auto dvar_end_part = (x_map - mean_map.replicate(1, right)) - .cwiseProduct(d_y_map) - .rowwise() - .sum(); - auto dvar_end = inv_std_map.unaryExpr(triple_product_func) - .cwiseProduct(dvar_end_part) - .replicate(1, right); - auto dx_var = - (T(-1.0) / right) * - (x_map - mean_map.replicate(1, right)).cwiseProduct(dvar_end); - - d_x_map = dx_end + dx_mean + dx_var; - } - } - } -}; - } // namespace operators } // namespace paddle diff --git a/paddle/operators/layer_norm_op.h b/paddle/operators/layer_norm_op.h index 2de58186fbd..608447b1ff8 100644 --- a/paddle/operators/layer_norm_op.h +++ b/paddle/operators/layer_norm_op.h @@ -31,7 +31,7 @@ template struct DivAndSqrtFunctor { explicit DivAndSqrtFunctor(T epsilon) { epsilon_ = epsilon; } inline HOSTDEVICE T operator()(T a, T b) const { - return a / (sqrt(b) + epsilon_); + return a / (sqrt(b + epsilon_)); } private: diff --git a/python/paddle/v2/fluid/tests/test_layer_norm_op.py b/python/paddle/v2/fluid/tests/test_layer_norm_op.py index f456b1194c5..4460ffaf9c4 100644 --- a/python/paddle/v2/fluid/tests/test_layer_norm_op.py +++ b/python/paddle/v2/fluid/tests/test_layer_norm_op.py @@ -20,6 +20,8 @@ import paddle.v2.fluid.core as core from paddle.v2.fluid.op import Operator from paddle.v2.fluid.framework import grad_var_name +np.random.random(123) + def _reference_layer_norm_naive(x, scale, beta, epsilon, begin_norm_axis=1): x_shape = x.shape @@ -148,7 +150,7 @@ class TestLayerNormdOp(OpTest): x_shape = shape D = reduce(mul, x_shape[begin_norm_axis:len(x_shape)], 1) scale_shape = [D] - np.random.random(123) + x_val = np.random.random_sample(x_shape).astype(np.float32) scale_val = np.random.random_sample(scale_shape).astype(np.float32) bias_val = np.random.random_sample(scale_shape).astype(np.float32) -- GitLab From 677312973516832a495a0f83fbcc8b5c55e977f6 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Mon, 5 Feb 2018 13:40:11 +0800 Subject: [PATCH 08/55] code refine --- paddle/operators/layer_norm_op.h | 42 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/paddle/operators/layer_norm_op.h b/paddle/operators/layer_norm_op.h index 608447b1ff8..3c436b89263 100644 --- a/paddle/operators/layer_norm_op.h +++ b/paddle/operators/layer_norm_op.h @@ -97,15 +97,15 @@ class LayerNormKernel : public framework::OpKernel { auto &dev_ctx = ctx.template device_context(); math::RowwiseMean row_mean; - // functor-> get mean + // get mean row_mean(dev_ctx, x, mean); - // functor-> get variance + // get variance ElementwiseComputeEx, DeviceContext, T>( ctx, &x, mean, /*axis*/ 0, SubAndSquareFunctor(), &out); row_mean(dev_ctx, out, var); - // functor-> get norm_out + // get x_norm ElementwiseComputeEx, DeviceContext, T>( ctx, &x, mean, /*axis*/ 0, SubFunctor(), &out); ElementwiseComputeEx, DeviceContext, T>( @@ -129,9 +129,11 @@ class LayerNormGradKernel : public framework::OpKernel { void Compute(const framework::ExecutionContext &ctx) const override { const float epsilon = ctx.Attr("epsilon"); auto x = *ctx.Input("X"); - auto mean = *ctx.Input("Mean"); - auto var = *ctx.Input("Variance"); - auto scale = *ctx.Input("Scale"); + auto *y = ctx.Input("Y"); + auto *mean = ctx.Input("Mean"); + auto *var = ctx.Input("Variance"); + auto *scale = ctx.Input("Scale"); + auto *bias = ctx.Input("Bias"); auto d_y = *ctx.Input(framework::GradVarName("Y")); const auto begin_norm_axis = ctx.Attr("begin_norm_axis"); @@ -155,14 +157,19 @@ class LayerNormGradKernel : public framework::OpKernel { if (d_scale || d_x) { x.Resize(matrix_shape); temp.mutable_data(matrix_shape, ctx.GetPlace()); - temp_norm.mutable_data(matrix_shape, ctx.GetPlace()); - // get x_norm - ElementwiseComputeEx, DeviceContext, T>( - ctx, &x, &mean, /*axis*/ 0, SubFunctor(), &temp_norm); - ElementwiseComputeEx, DeviceContext, T>( - ctx, &temp_norm, &var, /*axis*/ 0, - DivAndSqrtFunctor(static_cast(epsilon)), &temp_norm); + if (!(bias && scale)) { + temp_norm.ShareDataWith(*y); + temp_norm.Resize(matrix_shape); + } else { + temp_norm.mutable_data(matrix_shape, ctx.GetPlace()); + // get x_norm + ElementwiseComputeEx, DeviceContext, T>( + ctx, &x, mean, /*axis*/ 0, SubFunctor(), &temp_norm); + ElementwiseComputeEx, DeviceContext, T>( + ctx, &temp_norm, var, /*axis*/ 0, + DivAndSqrtFunctor(static_cast(epsilon)), &temp_norm); + } } if (d_bias) { @@ -188,7 +195,7 @@ class LayerNormGradKernel : public framework::OpKernel { if (d_scale) { // dy_dx ElementwiseComputeEx, DeviceContext, T>( - ctx, &d_y, &scale, /*axis*/ 1, MulFunctor(), &temp); + ctx, &d_y, scale, /*axis*/ 1, MulFunctor(), &temp); framework::Copy(temp, ctx.GetPlace(), ctx.device_context(), d_x); // dy_dmean_dx @@ -199,7 +206,6 @@ class LayerNormGradKernel : public framework::OpKernel { // dy_var_dx ElementwiseComputeEx, DeviceContext, T>( ctx, &temp, &temp_norm, /*axis*/ 0, MulFunctor(), &temp); - } else { // dy_dx framework::Copy(d_y, ctx.GetPlace(), ctx.device_context(), d_x); @@ -216,12 +222,12 @@ class LayerNormGradKernel : public framework::OpKernel { // dy_var_dx row_mean(dev_ctx, temp, &temp_vec); ElementwiseComputeEx, DeviceContext, T>( - ctx, &temp_norm, &temp_vec, /*axis*/ 0, MulFunctor(), &temp_norm); + ctx, &temp_norm, &temp_vec, /*axis*/ 0, MulFunctor(), &temp); ElementwiseComputeEx, DeviceContext, T>( - ctx, d_x, &temp_norm, /*axis*/ 0, SubFunctor(), d_x); + ctx, d_x, &temp, /*axis*/ 0, SubFunctor(), d_x); ElementwiseComputeEx, DeviceContext, T>( - ctx, d_x, &var, /*axis*/ 0, + ctx, d_x, var, /*axis*/ 0, DivAndSqrtFunctor(static_cast(epsilon)), d_x); d_x->Resize(dx_dim); } -- GitLab From 6f0e630c5ce67bef5e87e26441c60870d1ab207e Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Mon, 5 Feb 2018 13:25:20 -0800 Subject: [PATCH 09/55] fix prune and program desc constructor --- paddle/framework/block_desc.cc | 2 ++ paddle/framework/op_desc.cc | 17 +++++++-- paddle/framework/program_desc.cc | 18 ++++++++++ paddle/framework/prune.cc | 36 ++++++++++++------- python/paddle/v2/fluid/io.py | 6 ++++ .../tests/book/test_rnn_encoder_decoder.py | 31 ++++++++++------ 6 files changed, 85 insertions(+), 25 deletions(-) diff --git a/paddle/framework/block_desc.cc b/paddle/framework/block_desc.cc index dd2ed872521..ca3d03e5541 100644 --- a/paddle/framework/block_desc.cc +++ b/paddle/framework/block_desc.cc @@ -155,6 +155,8 @@ BlockDesc::BlockDesc(ProgramDesc *prog, proto::BlockDesc *desc) for (const proto::OpDesc &op_desc : desc_->ops()) { ops_.emplace_back(new OpDesc(op_desc, prog, this)); } + std::cout << "Constructed block idx " << desc->idx() << " from protobuf str" + << std::endl; } BlockDesc::BlockDesc(const BlockDesc &other, proto::BlockDesc *desc, diff --git a/paddle/framework/op_desc.cc b/paddle/framework/op_desc.cc index f8df2cf97ad..5ebd2b3ad5e 100644 --- a/paddle/framework/op_desc.cc +++ b/paddle/framework/op_desc.cc @@ -124,11 +124,24 @@ OpDesc::OpDesc(const proto::OpDesc &desc, ProgramDesc *prog, BlockDesc *block) // restore attrs_ for (const proto::OpDesc::Attr &attr : desc_.attrs()) { std::string attr_name = attr.name(); + // we use a trick to handle attr.type() is BLOCK here, because at this + // moment the sub_block hasn't beed added to ProgramDesc's vector + // so we cast the block_idx to a dummy BlockDesc pointer if (attr.type() != proto::AttrType::BLOCK) { attrs_[attr_name] = GetAttrValue(attr); } else { - auto bid = attr.block_idx(); - attrs_[attr_name] = prog->MutableBlock(bid); + size_t blk_idx = attr.block_idx(); + if (blk_idx < prog->Size()) { + attrs_[attr_name] = prog->MutableBlock(blk_idx); + } else { + std::cout << "Setting blockdesc attribute for id " << blk_idx + << std::endl; + attrs_[attr_name] = reinterpret_cast(blk_idx); + std::cout << "Testing reinterpret_cast result is " + << reinterpret_cast( + boost::get(attrs_[attr_name])) + << std::endl; + } } } this->block_ = block; diff --git a/paddle/framework/program_desc.cc b/paddle/framework/program_desc.cc index 15ea4035c6e..9124607623b 100644 --- a/paddle/framework/program_desc.cc +++ b/paddle/framework/program_desc.cc @@ -52,9 +52,27 @@ ProgramDesc::ProgramDesc(const ProgramDesc &o) { ProgramDesc::ProgramDesc(const proto::ProgramDesc &desc) { desc_ = desc; + std::cout << std::endl << "starting in ProgDesc constructor" << std::endl; for (auto &block_desc : *desc_.mutable_blocks()) { blocks_.emplace_back(new BlockDesc(this, &block_desc)); + std::cout << "Done constructing block idx " << block_desc.idx() + << " parent idx " << block_desc.parent_idx() << std::endl; } + for (auto &block : blocks_) { + for (auto *op : block->AllOps()) { + for (auto &name : op->AttrNames()) { + if (op->GetAttrType(name) == proto::AttrType::BLOCK) { + auto attr = op->GetAttr(name); + size_t blk_idx = + reinterpret_cast(boost::get(attr)); + op->SetBlockAttr(name, *this->MutableBlock(blk_idx)); + std::cout << "Update attr name " << name << " for block idx " + << blk_idx << std::endl; + } + } + } + } + std::cout << "Done ProgDesc construction" << std::endl << std::endl; } ProgramDesc::ProgramDesc(const std::string &binary_str) { diff --git a/paddle/framework/prune.cc b/paddle/framework/prune.cc index 6a3882f199e..3c3ec875851 100644 --- a/paddle/framework/prune.cc +++ b/paddle/framework/prune.cc @@ -109,15 +109,14 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, // we reverse the should_run vector std::reverse(should_run.begin(), should_run.end()); - //*output = input; // copy the current block from input to output auto* block_field = output->mutable_blocks(); *block_field->Add() = input.blocks(block_id); int output_block_id = output->blocks_size() - 1; auto* output_block = output->mutable_blocks(output_block_id); - output_block->set_idx = output_block_id; - output_block->set_parent_idx = parent_block_id; + output_block->set_idx(output_block_id); + output_block->set_parent_idx(parent_block_id); auto* op_field = output_block->mutable_ops(); op_field->Clear(); @@ -128,17 +127,18 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, if (HasSubBlock(*op)) { // create sub_block_dependent_vars here to help prune the sub block std::set sub_block_dependent_vars; - for (auto& var : op.inputs()) { + for (auto& var : op->inputs()) { for (auto& argu : var.arguments()) { sub_block_dependent_vars.insert(argu); } } - for (auto& var : op.outputs()) { + for (auto& var : op->outputs()) { for (auto& argu : var.arguments()) { sub_block_dependent_vars.insert(argu); } } - + std::cout << "pruning the next block, the current output_block_id is " + << output_block_id << std::endl; // GetSubBlockIndex(*op) is the idx of the sub_block in the input desc // output_block_id is the idx of the current block in the output desc prune_impl(input, output, GetSubBlockIndex(*op), output_block_id, @@ -147,6 +147,8 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, } } + std::cout << "Starting to remove unreferenced variables" + << " for block idx " << output_block_id << std::endl; // remove the VarDescs in BlockDesc that are not referenced in // the pruned OpDescs std::unordered_map var_map; @@ -155,28 +157,38 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, var_map[var.name()] = var; } - var_field->Clear(); + std::set var_names; for (const auto& op : *op_field) { - // add VarDescs of all input arguments for each OpDesc auto& input_field = op.inputs(); for (auto& input_var : input_field) { for (auto& arg : input_var.arguments()) { - *var_field->Add() = var_map.at(arg); + if (var_map.count(arg) != 0) { + var_names.insert(arg); + } } } - // add VarDescs of all output arguments for each OpDesc auto& output_field = op.outputs(); for (auto& output_var : output_field) { for (auto& arg : output_var.arguments()) { - *var_field->Add() = var_map.at(arg); + if (var_map.count(arg) != 0) { + var_names.insert(arg); + } } } } + + var_field->Clear(); + for (const auto& name : var_names) { + *var_field->Add() = var_map[name]; + } } // TODO(fengjiayi): Prune() could be inplaced to avoid unnecessary copies void Prune(const proto::ProgramDesc& input, proto::ProgramDesc* output) { - prune_impl(input, output, 0, -1, {}); + std::set dependent_vars; + std::cout << std::endl << "Start C++ framework::prune" << std::endl; + prune_impl(input, output, 0, -1, dependent_vars); + std::cout << "Finished C++ framework::prune" << std::endl << std::endl; } void inference_optimize_impl(const proto::ProgramDesc& input, diff --git a/python/paddle/v2/fluid/io.py b/python/paddle/v2/fluid/io.py index 613dc20b6ea..e410549f8a5 100644 --- a/python/paddle/v2/fluid/io.py +++ b/python/paddle/v2/fluid/io.py @@ -342,6 +342,12 @@ def save_inference_model(dirname, prepend_feed_ops(inference_program, feeded_var_names) append_fetch_ops(inference_program, fetch_var_names) + # save for checking + curstr = inference_program.to_string(True) + f = open("save_inf_prog_after_feed_fetch.txt", 'w') + f.write(curstr) + f.close() + model_file_name = dirname + "/__model__" with open(model_file_name, "wb") as f: f.write(inference_program.desc.serialize_to_string()) diff --git a/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py b/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py index 593d0013c9d..15f00f95d40 100644 --- a/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py +++ b/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py @@ -197,14 +197,15 @@ def train(save_dirname=None): " avg_cost=" + str(avg_cost_val)) if batch_id > 3: if save_dirname is not None: - fluid.io.save_inference_model(save_dirname, [ - 'source_sequence', 'target_sequence', 'label_sequence' - ], [prediction], exe) + fluid.io.save_inference_model( + save_dirname, ['source_sequence', + 'target_sequence'], [prediction], exe) + return exit(0) batch_id += 1 -def inference(save_dirname=None): +def infer(save_dirname=None): if save_dirname is None: return @@ -221,24 +222,32 @@ def inference(save_dirname=None): data = [[0, 1, 0, 1], [0, 1, 1, 0, 0, 1]] word_data = to_lodtensor(data, place) trg_word = to_lodtensor(data, place) - trg_word_next = to_lodtensor(data, place) # Construct feed as a dictionary of {feed_target_name: feed_target_data} # and results will contain a list of data corresponding to fetch_targets. + print("Print feed fetch target names as follows") print(feed_target_names) assert feed_target_names[0] == 'source_sequence' assert feed_target_names[1] == 'target_sequence' - assert feed_target_names[2] == 'label_sequence' + print([var.name for var in fetch_targets]) + + # save for checking + curstr = inference_program.to_string(True) + f = open("loaded_infer_prog.txt", 'w') + f.write(curstr) + f.close() + results = exe.run(inference_program, feed={ feed_target_names[0]: word_data, feed_target_names[1]: trg_word, - feed_target_names[2]: trg_word_next }, - fetch_list=fetch_targets) - - print("Inference Shape: ", results[0].shape) - print("infer results: ", results[0]) + fetch_list=fetch_targets, + return_numpy=False) + print(results[0].lod()) + np_data = np.array(results[0]) + print("Inference shape: ", np_data.shape) + print("Inference results: ", np_data) if __name__ == '__main__': -- GitLab From dc68e7c44b198acbdf588e97d219822602dc90db Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Mon, 5 Feb 2018 15:36:54 -0800 Subject: [PATCH 10/55] fix constructor bug --- paddle/framework/op_desc.cc | 9 +++------ paddle/framework/program_desc.cc | 26 ++++++++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/paddle/framework/op_desc.cc b/paddle/framework/op_desc.cc index 5ebd2b3ad5e..7859c391fa3 100644 --- a/paddle/framework/op_desc.cc +++ b/paddle/framework/op_desc.cc @@ -133,13 +133,10 @@ OpDesc::OpDesc(const proto::OpDesc &desc, ProgramDesc *prog, BlockDesc *block) size_t blk_idx = attr.block_idx(); if (blk_idx < prog->Size()) { attrs_[attr_name] = prog->MutableBlock(blk_idx); - } else { - std::cout << "Setting blockdesc attribute for id " << blk_idx + std::cout << "In OpDesc: set up attr block idx " << blk_idx << std::endl; - attrs_[attr_name] = reinterpret_cast(blk_idx); - std::cout << "Testing reinterpret_cast result is " - << reinterpret_cast( - boost::get(attrs_[attr_name])) + } else { + std::cout << "In OpDesc: We don't have this block idx " << blk_idx << std::endl; } } diff --git a/paddle/framework/program_desc.cc b/paddle/framework/program_desc.cc index 9124607623b..ba461b09339 100644 --- a/paddle/framework/program_desc.cc +++ b/paddle/framework/program_desc.cc @@ -48,6 +48,18 @@ ProgramDesc::ProgramDesc(const ProgramDesc &o) { auto *block = desc_.mutable_blocks(i); blocks_.emplace_back(new BlockDesc(*o.blocks_[i], block, this)); } + for (auto &block : blocks_) { + for (auto *op : block->AllOps()) { + for (const auto &attr : op->Proto()->attrs()) { + if (attr.type() == proto::AttrType::BLOCK) { + size_t blk_idx = attr.block_idx(); + op->SetBlockAttr(attr.name(), *this->MutableBlock(blk_idx)); + std::cout << "In ProgramDesc 1: set block attr idx " << blk_idx + << std::endl; + } + } + } + } } ProgramDesc::ProgramDesc(const proto::ProgramDesc &desc) { @@ -60,14 +72,12 @@ ProgramDesc::ProgramDesc(const proto::ProgramDesc &desc) { } for (auto &block : blocks_) { for (auto *op : block->AllOps()) { - for (auto &name : op->AttrNames()) { - if (op->GetAttrType(name) == proto::AttrType::BLOCK) { - auto attr = op->GetAttr(name); - size_t blk_idx = - reinterpret_cast(boost::get(attr)); - op->SetBlockAttr(name, *this->MutableBlock(blk_idx)); - std::cout << "Update attr name " << name << " for block idx " - << blk_idx << std::endl; + for (const auto &attr : op->Proto()->attrs()) { + if (attr.type() == proto::AttrType::BLOCK) { + size_t blk_idx = attr.block_idx(); + op->SetBlockAttr(attr.name(), *this->MutableBlock(blk_idx)); + std::cout << "In ProgramDesc 2: set block attr idx " << blk_idx + << std::endl; } } } -- GitLab From d5686f5831adea6bc9b0ceb94b81cd3f79270800 Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Mon, 5 Feb 2018 18:00:07 -0800 Subject: [PATCH 11/55] clean code --- paddle/framework/block_desc.cc | 5 +---- paddle/framework/op_desc.cc | 15 ++------------- paddle/framework/program_desc.cc | 9 --------- paddle/framework/prune.cc | 6 ------ python/paddle/v2/fluid/io.py | 6 ------ .../fluid/tests/book/test_rnn_encoder_decoder.py | 10 ---------- 6 files changed, 3 insertions(+), 48 deletions(-) diff --git a/paddle/framework/block_desc.cc b/paddle/framework/block_desc.cc index ca3d03e5541..3e344ea3790 100644 --- a/paddle/framework/block_desc.cc +++ b/paddle/framework/block_desc.cc @@ -155,8 +155,6 @@ BlockDesc::BlockDesc(ProgramDesc *prog, proto::BlockDesc *desc) for (const proto::OpDesc &op_desc : desc_->ops()) { ops_.emplace_back(new OpDesc(op_desc, prog, this)); } - std::cout << "Constructed block idx " << desc->idx() << " from protobuf str" - << std::endl; } BlockDesc::BlockDesc(const BlockDesc &other, proto::BlockDesc *desc, @@ -164,9 +162,8 @@ BlockDesc::BlockDesc(const BlockDesc &other, proto::BlockDesc *desc, : prog_(prog), desc_(desc) { need_update_ = true; for (auto &op : other.ops_) { - ops_.emplace_back(new OpDesc(*op, this)); + ops_.emplace_back(new OpDesc(*op->Proto(), prog, this)); } - for (auto &it : other.vars_) { auto *var = new VarDesc(*it.second); vars_[it.first].reset(var); diff --git a/paddle/framework/op_desc.cc b/paddle/framework/op_desc.cc index 7859c391fa3..46c50d9250f 100644 --- a/paddle/framework/op_desc.cc +++ b/paddle/framework/op_desc.cc @@ -124,21 +124,10 @@ OpDesc::OpDesc(const proto::OpDesc &desc, ProgramDesc *prog, BlockDesc *block) // restore attrs_ for (const proto::OpDesc::Attr &attr : desc_.attrs()) { std::string attr_name = attr.name(); - // we use a trick to handle attr.type() is BLOCK here, because at this - // moment the sub_block hasn't beed added to ProgramDesc's vector - // so we cast the block_idx to a dummy BlockDesc pointer + // The sub_block referred to by the BLOCK attr hasn't be added + // to ProgramDesc class yet, we skip setting BLOCK attr here. if (attr.type() != proto::AttrType::BLOCK) { attrs_[attr_name] = GetAttrValue(attr); - } else { - size_t blk_idx = attr.block_idx(); - if (blk_idx < prog->Size()) { - attrs_[attr_name] = prog->MutableBlock(blk_idx); - std::cout << "In OpDesc: set up attr block idx " << blk_idx - << std::endl; - } else { - std::cout << "In OpDesc: We don't have this block idx " << blk_idx - << std::endl; - } } } this->block_ = block; diff --git a/paddle/framework/program_desc.cc b/paddle/framework/program_desc.cc index ba461b09339..0e937dda4e1 100644 --- a/paddle/framework/program_desc.cc +++ b/paddle/framework/program_desc.cc @@ -43,7 +43,6 @@ ProgramDesc::ProgramDesc() { ProgramDesc::ProgramDesc(const ProgramDesc &o) { desc_ = o.desc_; - for (int i = 0; i < desc_.blocks_size(); ++i) { auto *block = desc_.mutable_blocks(i); blocks_.emplace_back(new BlockDesc(*o.blocks_[i], block, this)); @@ -54,8 +53,6 @@ ProgramDesc::ProgramDesc(const ProgramDesc &o) { if (attr.type() == proto::AttrType::BLOCK) { size_t blk_idx = attr.block_idx(); op->SetBlockAttr(attr.name(), *this->MutableBlock(blk_idx)); - std::cout << "In ProgramDesc 1: set block attr idx " << blk_idx - << std::endl; } } } @@ -64,11 +61,8 @@ ProgramDesc::ProgramDesc(const ProgramDesc &o) { ProgramDesc::ProgramDesc(const proto::ProgramDesc &desc) { desc_ = desc; - std::cout << std::endl << "starting in ProgDesc constructor" << std::endl; for (auto &block_desc : *desc_.mutable_blocks()) { blocks_.emplace_back(new BlockDesc(this, &block_desc)); - std::cout << "Done constructing block idx " << block_desc.idx() - << " parent idx " << block_desc.parent_idx() << std::endl; } for (auto &block : blocks_) { for (auto *op : block->AllOps()) { @@ -76,13 +70,10 @@ ProgramDesc::ProgramDesc(const proto::ProgramDesc &desc) { if (attr.type() == proto::AttrType::BLOCK) { size_t blk_idx = attr.block_idx(); op->SetBlockAttr(attr.name(), *this->MutableBlock(blk_idx)); - std::cout << "In ProgramDesc 2: set block attr idx " << blk_idx - << std::endl; } } } } - std::cout << "Done ProgDesc construction" << std::endl << std::endl; } ProgramDesc::ProgramDesc(const std::string &binary_str) { diff --git a/paddle/framework/prune.cc b/paddle/framework/prune.cc index 3c3ec875851..00fe551e55e 100644 --- a/paddle/framework/prune.cc +++ b/paddle/framework/prune.cc @@ -137,8 +137,6 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, sub_block_dependent_vars.insert(argu); } } - std::cout << "pruning the next block, the current output_block_id is " - << output_block_id << std::endl; // GetSubBlockIndex(*op) is the idx of the sub_block in the input desc // output_block_id is the idx of the current block in the output desc prune_impl(input, output, GetSubBlockIndex(*op), output_block_id, @@ -147,8 +145,6 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, } } - std::cout << "Starting to remove unreferenced variables" - << " for block idx " << output_block_id << std::endl; // remove the VarDescs in BlockDesc that are not referenced in // the pruned OpDescs std::unordered_map var_map; @@ -186,9 +182,7 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, // TODO(fengjiayi): Prune() could be inplaced to avoid unnecessary copies void Prune(const proto::ProgramDesc& input, proto::ProgramDesc* output) { std::set dependent_vars; - std::cout << std::endl << "Start C++ framework::prune" << std::endl; prune_impl(input, output, 0, -1, dependent_vars); - std::cout << "Finished C++ framework::prune" << std::endl << std::endl; } void inference_optimize_impl(const proto::ProgramDesc& input, diff --git a/python/paddle/v2/fluid/io.py b/python/paddle/v2/fluid/io.py index e410549f8a5..613dc20b6ea 100644 --- a/python/paddle/v2/fluid/io.py +++ b/python/paddle/v2/fluid/io.py @@ -342,12 +342,6 @@ def save_inference_model(dirname, prepend_feed_ops(inference_program, feeded_var_names) append_fetch_ops(inference_program, fetch_var_names) - # save for checking - curstr = inference_program.to_string(True) - f = open("save_inf_prog_after_feed_fetch.txt", 'w') - f.write(curstr) - f.close() - model_file_name = dirname + "/__model__" with open(model_file_name, "wb") as f: f.write(inference_program.desc.serialize_to_string()) diff --git a/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py b/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py index 15f00f95d40..2211637b5b0 100644 --- a/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py +++ b/python/paddle/v2/fluid/tests/book/test_rnn_encoder_decoder.py @@ -225,18 +225,8 @@ def infer(save_dirname=None): # Construct feed as a dictionary of {feed_target_name: feed_target_data} # and results will contain a list of data corresponding to fetch_targets. - print("Print feed fetch target names as follows") - print(feed_target_names) assert feed_target_names[0] == 'source_sequence' assert feed_target_names[1] == 'target_sequence' - print([var.name for var in fetch_targets]) - - # save for checking - curstr = inference_program.to_string(True) - f = open("loaded_infer_prog.txt", 'w') - f.write(curstr) - f.close() - results = exe.run(inference_program, feed={ feed_target_names[0]: word_data, -- GitLab From 450c39a41301800f9b71e499d539ff7bbbd7414f Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Mon, 5 Feb 2018 20:39:38 -0800 Subject: [PATCH 12/55] fix bug --- paddle/framework/prune.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/framework/prune.cc b/paddle/framework/prune.cc index 00fe551e55e..ddd6b993d40 100644 --- a/paddle/framework/prune.cc +++ b/paddle/framework/prune.cc @@ -182,6 +182,7 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, // TODO(fengjiayi): Prune() could be inplaced to avoid unnecessary copies void Prune(const proto::ProgramDesc& input, proto::ProgramDesc* output) { std::set dependent_vars; + output->clear_blocks(); prune_impl(input, output, 0, -1, dependent_vars); } -- GitLab From d2a31fb8aa653485c9364f896ba0f3c9c9253737 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Wed, 7 Feb 2018 15:20:50 +0800 Subject: [PATCH 13/55] refine unit test --- paddle/framework/channel_test.cc | 147 +++++++------------- paddle/framework/details/buffered_channel.h | 7 + 2 files changed, 56 insertions(+), 98 deletions(-) diff --git a/paddle/framework/channel_test.cc b/paddle/framework/channel_test.cc index df9e15e22b8..3b8150b4276 100644 --- a/paddle/framework/channel_test.cc +++ b/paddle/framework/channel_test.cc @@ -115,7 +115,7 @@ TEST(Channel, ConcurrentSendNonConcurrentReceiveWithSufficientBufferSize) { sum += i; } }); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait 0.5 sec + std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait 0.1 sec EXPECT_EQ(sum, 45U); CloseChannel(ch); @@ -144,38 +144,34 @@ TEST(Channel, SimpleUnbufferedChannelTest) { delete ch; } -// This tests that closing a buffered channel also unblocks -// any receivers waiting on the channel -TEST(Channel, BufferedChannelCloseUnblocksReceiversTest) { - auto ch = MakeChannel(1); +void ChannelCloseUnblocksReceiversTest(Channel *ch) { size_t num_threads = 5; std::thread t[num_threads]; bool thread_ended[num_threads]; - // Launches threads that try to read and are blocked because of no writers + // Launches threads that try to read and are blocked becausew of no writers for (size_t i = 0; i < num_threads; i++) { thread_ended[i] = false; t[i] = std::thread( [&](bool *p) { int data; - // All reads should return false EXPECT_EQ(ch->Receive(&data), false); *p = true; }, &thread_ended[i]); } - std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait + std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait 0.1 sec - // Verify that all threads are blocked + // Verify that all the threads are blocked for (size_t i = 0; i < num_threads; i++) { EXPECT_EQ(thread_ended[i], false); } - // Explicitly close the channel + // Explicitly close the thread // This should unblock all receivers CloseChannel(ch); - std::this_thread::sleep_for(std::chrono::milliseconds(200)); // wait + std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait 0.1 sec // Verify that all threads got unblocked for (size_t i = 0; i < num_threads; i++) { @@ -183,13 +179,12 @@ TEST(Channel, BufferedChannelCloseUnblocksReceiversTest) { } for (size_t i = 0; i < num_threads; i++) t[i].join(); - delete ch; } -// This tests that closing a buffered channel also unblocks -// any senders waiting for channel to have write space -TEST(Channel, BufferedChannelCloseUnblocksSendersTest) { - auto ch = MakeChannel(1); +void ChannelCloseUnblocksSendersTest(Channel *ch) { + using paddle::framework::details::Buffered; + using paddle::framework::details::UnBuffered; + size_t num_threads = 5; std::thread t[num_threads]; bool thread_ended[num_threads]; @@ -209,34 +204,56 @@ TEST(Channel, BufferedChannelCloseUnblocksSendersTest) { } std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait - // Verify that atleast 4 threads are blocked - int ct = 0; - for (size_t i = 0; i < num_threads; i++) { - if (thread_ended[i] == false) ct++; + if (dynamic_cast *>(ch)) { + // If ch is Buffered, atleast 4 threads must be blocked. + int ct = 0; + for (size_t i = 0; i < num_threads; i++) { + if (!thread_ended[i]) ct++; + } + EXPECT_GE(ct, 4); + } else { + // If ch is UnBuffered, all the threads should be blocked. + for (size_t i = 0; i < num_threads; i++) { + EXPECT_EQ(thread_ended[i], false); + } } - // Atleast 4 threads must be blocked - EXPECT_GE(ct, 4); - // Explicitly close the thread // This should unblock all senders CloseChannel(ch); - std::this_thread::sleep_for(std::chrono::milliseconds(200)); // wait + std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait // Verify that all threads got unblocked for (size_t i = 0; i < num_threads; i++) { EXPECT_EQ(thread_ended[i], true); } - // Verify that only 1 send was successful - ct = 0; - for (size_t i = 0; i < num_threads; i++) { - if (send_success[i]) ct++; + if (dynamic_cast *>(ch)) { + // Verify that only 1 send was successful + int ct = 0; + for (size_t i = 0; i < num_threads; i++) { + if (send_success[i]) ct++; + } + // Only 1 send must be successful + EXPECT_EQ(ct, 1); } - // Only 1 send must be successful - EXPECT_EQ(ct, 1); for (size_t i = 0; i < num_threads; i++) t[i].join(); +} + +// This tests that closing a buffered channel also unblocks +// any receivers waiting on the channel +TEST(Channel, BufferedChannelCloseUnblocksReceiversTest) { + auto ch = MakeChannel(1); + ChannelCloseUnblocksReceiversTest(ch); + delete ch; +} + +// This tests that closing a buffered channel also unblocks +// any senders waiting for channel to have write space +TEST(Channel, BufferedChannelCloseUnblocksSendersTest) { + auto ch = MakeChannel(1); + ChannelCloseUnblocksSendersTest(ch); delete ch; } @@ -244,40 +261,7 @@ TEST(Channel, BufferedChannelCloseUnblocksSendersTest) { // unblocks any receivers waiting for senders TEST(Channel, UnbufferedChannelCloseUnblocksReceiversTest) { auto ch = MakeChannel(0); - size_t num_threads = 5; - std::thread t[num_threads]; - bool thread_ended[num_threads]; - - // Launches threads that try to read and are blocked becausew of no writers - for (size_t i = 0; i < num_threads; i++) { - thread_ended[i] = false; - t[i] = std::thread( - [&](bool *p) { - int data; - EXPECT_EQ(ch->Receive(&data), false); - *p = true; - }, - &thread_ended[i]); - } - std::this_thread::sleep_for(std::chrono::milliseconds(500)); // wait 0.5 sec - - // Verify that all the threads are blocked - for (size_t i = 0; i < num_threads; i++) { - EXPECT_EQ(thread_ended[i], false); - } - - // Explicitly close the thread - // This should unblock all receivers - CloseChannel(ch); - - std::this_thread::sleep_for(std::chrono::milliseconds(500)); // wait 0.5 sec - - // Verify that all threads got unblocked - for (size_t i = 0; i < num_threads; i++) { - EXPECT_EQ(thread_ended[i], true); - } - - for (size_t i = 0; i < num_threads; i++) t[i].join(); + ChannelCloseUnblocksReceiversTest(ch); delete ch; } @@ -285,40 +269,7 @@ TEST(Channel, UnbufferedChannelCloseUnblocksReceiversTest) { // unblocks any senders waiting for senders TEST(Channel, UnbufferedChannelCloseUnblocksSendersTest) { auto ch = MakeChannel(0); - size_t num_threads = 5; - std::thread t[num_threads]; - bool thread_ended[num_threads]; - - // Launches threads that try to read and are blocked becausew of no writers - for (size_t i = 0; i < num_threads; i++) { - thread_ended[i] = false; - t[i] = std::thread( - [&](bool *p) { - int data = 10; - EXPECT_EQ(ch->Send(&data), false); - *p = true; - }, - &thread_ended[i]); - } - std::this_thread::sleep_for(std::chrono::milliseconds(500)); // wait 0.5 sec - - // Verify that all the threads are blocked - for (size_t i = 0; i < num_threads; i++) { - EXPECT_EQ(thread_ended[i], false); - } - - // Explicitly close the thread - // This should unblock all receivers - CloseChannel(ch); - - std::this_thread::sleep_for(std::chrono::milliseconds(500)); // wait 0.5 sec - - // Verify that all threads got unblocked - for (size_t i = 0; i < num_threads; i++) { - EXPECT_EQ(thread_ended[i], true); - } - - for (size_t i = 0; i < num_threads; i++) t[i].join(); + ChannelCloseUnblocksReceiversTest(ch); delete ch; } diff --git a/paddle/framework/details/buffered_channel.h b/paddle/framework/details/buffered_channel.h index 00b63da4da7..44bf84eb309 100644 --- a/paddle/framework/details/buffered_channel.h +++ b/paddle/framework/details/buffered_channel.h @@ -25,6 +25,13 @@ namespace paddle { namespace framework { namespace details { +// Four of the properties of Buffered Channel: +// - A send to a full channel blocks temporarily until a receive from the +// channel or the channel is closed +// - A receive from an empty channel blocks temporarily until a send to the +// channel or the channel is closed +// - A send to a closed channel returns false immediately +// - A receive from a closed channel returns false immediately template class Buffered : public paddle::framework::Channel { friend Channel* paddle::framework::MakeChannel(size_t); -- GitLab From dff5a8e6da5038e549c7ab66e1dbb94f619646d9 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Wed, 7 Feb 2018 15:48:50 +0800 Subject: [PATCH 14/55] add the properties of buffered channel and unbuffered channel --- paddle/framework/details/buffered_channel.h | 9 +++++---- paddle/framework/details/unbuffered_channel.h | 7 +++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/paddle/framework/details/buffered_channel.h b/paddle/framework/details/buffered_channel.h index 44bf84eb309..4275f919bad 100644 --- a/paddle/framework/details/buffered_channel.h +++ b/paddle/framework/details/buffered_channel.h @@ -27,11 +27,12 @@ namespace details { // Four of the properties of Buffered Channel: // - A send to a full channel blocks temporarily until a receive from the -// channel or the channel is closed +// channel or the channel is closed. // - A receive from an empty channel blocks temporarily until a send to the -// channel or the channel is closed -// - A send to a closed channel returns false immediately -// - A receive from a closed channel returns false immediately +// channel or the channel is closed. +// - A send to a closed channel returns false immediately. +// - A receive from a closed channel returns false immediately. + template class Buffered : public paddle::framework::Channel { friend Channel* paddle::framework::MakeChannel(size_t); diff --git a/paddle/framework/details/unbuffered_channel.h b/paddle/framework/details/unbuffered_channel.h index 815cebad2d8..bc4233af738 100644 --- a/paddle/framework/details/unbuffered_channel.h +++ b/paddle/framework/details/unbuffered_channel.h @@ -23,6 +23,13 @@ namespace paddle { namespace framework { namespace details { +// Four of the properties of UnBuffered Channel: +// - A send to a channel blocks temporarily until a receive from the +// channel or the channel is closed. +// - A receive from a channel blocks temporarily until a send to the +// channel or the channel is closed. +// - A send to a closed channel returns false immediately. +// - A receive from a closed channel returns false immediately. template class UnBuffered : public paddle::framework::Channel { friend Channel* paddle::framework::MakeChannel(size_t); -- GitLab From 56ebb76c000fd56ba46baf64781a8c2df18955cd Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Wed, 7 Feb 2018 15:48:50 +0800 Subject: [PATCH 15/55] add the properties of buffered channel and unbuffered channel --- paddle/framework/channel_test.cc | 4 ++-- paddle/framework/details/buffered_channel.h | 9 +++++---- paddle/framework/details/unbuffered_channel.h | 7 +++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/paddle/framework/channel_test.cc b/paddle/framework/channel_test.cc index 3b8150b4276..95360d7b776 100644 --- a/paddle/framework/channel_test.cc +++ b/paddle/framework/channel_test.cc @@ -149,7 +149,7 @@ void ChannelCloseUnblocksReceiversTest(Channel *ch) { std::thread t[num_threads]; bool thread_ended[num_threads]; - // Launches threads that try to read and are blocked becausew of no writers + // Launches threads that try to read and are blocked because of no writers for (size_t i = 0; i < num_threads; i++) { thread_ended[i] = false; t[i] = std::thread( @@ -167,7 +167,7 @@ void ChannelCloseUnblocksReceiversTest(Channel *ch) { EXPECT_EQ(thread_ended[i], false); } - // Explicitly close the thread + // Explicitly close the channel // This should unblock all receivers CloseChannel(ch); diff --git a/paddle/framework/details/buffered_channel.h b/paddle/framework/details/buffered_channel.h index 44bf84eb309..4275f919bad 100644 --- a/paddle/framework/details/buffered_channel.h +++ b/paddle/framework/details/buffered_channel.h @@ -27,11 +27,12 @@ namespace details { // Four of the properties of Buffered Channel: // - A send to a full channel blocks temporarily until a receive from the -// channel or the channel is closed +// channel or the channel is closed. // - A receive from an empty channel blocks temporarily until a send to the -// channel or the channel is closed -// - A send to a closed channel returns false immediately -// - A receive from a closed channel returns false immediately +// channel or the channel is closed. +// - A send to a closed channel returns false immediately. +// - A receive from a closed channel returns false immediately. + template class Buffered : public paddle::framework::Channel { friend Channel* paddle::framework::MakeChannel(size_t); diff --git a/paddle/framework/details/unbuffered_channel.h b/paddle/framework/details/unbuffered_channel.h index 815cebad2d8..bc4233af738 100644 --- a/paddle/framework/details/unbuffered_channel.h +++ b/paddle/framework/details/unbuffered_channel.h @@ -23,6 +23,13 @@ namespace paddle { namespace framework { namespace details { +// Four of the properties of UnBuffered Channel: +// - A send to a channel blocks temporarily until a receive from the +// channel or the channel is closed. +// - A receive from a channel blocks temporarily until a send to the +// channel or the channel is closed. +// - A send to a closed channel returns false immediately. +// - A receive from a closed channel returns false immediately. template class UnBuffered : public paddle::framework::Channel { friend Channel* paddle::framework::MakeChannel(size_t); -- GitLab From c74445017d35ad344c5fc2a19a35c47a72358f3c Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Wed, 7 Feb 2018 19:18:48 +0800 Subject: [PATCH 16/55] refine distribute transpiler --- .../paddle/v2/fluid/distribute_transpiler.py | 124 +++++++++++++----- 1 file changed, 89 insertions(+), 35 deletions(-) diff --git a/python/paddle/v2/fluid/distribute_transpiler.py b/python/paddle/v2/fluid/distribute_transpiler.py index 121b407cae4..4eb103cc6ba 100644 --- a/python/paddle/v2/fluid/distribute_transpiler.py +++ b/python/paddle/v2/fluid/distribute_transpiler.py @@ -300,6 +300,9 @@ class DistributeTranspiler: pass return orig_shape + def _op_input_var(self, op, varname): + pass + def _is_op_on_pserver(self, endpoint, all_ops, idx): """ Recursively check if the op need to run on current server. @@ -309,29 +312,35 @@ class DistributeTranspiler: p.name for p in self.param_grad_ep_mapping[endpoint]["params"] ] op = all_ops[idx] - if op.inputs.has_key("Param"): - if op.inputs["Param"].name in param_names: + input_names = set(op.input_names) + # TODO(typhoonzero): using Param and Grad input name to identify + # that the operator is an optimization operator, need a better way. + if "Param" in input_names: + if op.input("Param")[0] in param_names: return True else: for n in param_names: - if same_or_split_var(n, op.inputs[ - "Param"].name) and n != op.inputs["Param"].name: + if same_or_split_var(n, op.input("Param")[0]) \ + and n != op.input("Param")[0]: return True return False else: j = idx - 1 while j >= 0: prev_op = all_ops[j] - prev_output_names = [o.name for o in prev_op.outputs.values()] - prev_input_names = [o.name for o in prev_op.inputs.values()] + # prev_output_names = [o.name for o in prev_op.outputs.values()] + # prev_input_names = [o.name for o in prev_op.inputs.values()] + # NOTE(typhoonzero): consider list input/output + prev_output_names = prev_op.desc.output_arg_names() + prev_input_names = prev_op.desc.input_arg_names() found1 = False found2 = False - for _, v in op.inputs.iteritems(): - if v.name in prev_output_names: + for varname in op.desc.input_arg_names(): + if varname in prev_output_names: found1 = self._is_op_on_pserver(endpoint, all_ops, j) # later ops may produce output for prev op's next batch use. - for _, v in op.outputs.iteritems(): - if v.name in prev_input_names: + for varname in op.desc.output_arg_names(): + if varname in prev_input_names: found2 = self._is_op_on_pserver(endpoint, all_ops, j) if found1 or found2: return True @@ -342,11 +351,11 @@ class DistributeTranspiler: new_inputs = dict() # update param/grad shape first, then other inputs like # moment can use the updated shape - for key, var in opt_op.inputs.iteritems(): + for key in opt_op.input_names: if key == "Grad": grad_block = None for g in self.param_grad_ep_mapping[endpoint]["grads"]: - if same_or_split_var(g.name, var.name): + if same_or_split_var(g.name, opt_op.input(key)[0]): grad_block = g break if not grad_block: @@ -376,7 +385,7 @@ class DistributeTranspiler: # param is already created on global program param_block = None for p in self.param_grad_ep_mapping[endpoint]["params"]: - if same_or_split_var(p.name, var.name): + if same_or_split_var(p.name, opt_op.input(key)): param_block = p break if not param_block: @@ -389,11 +398,12 @@ class DistributeTranspiler: new_inputs[key] = tmpvar - for key, var in opt_op.inputs.iteritems(): + for key in opt_op.input_names: if key in ["Param", "Grad"]: continue # update accumulator variable shape param_shape = new_inputs["Param"].shape + var = program.global_block().vars[opt_op.input(key)] new_shape = self._get_optimizer_input_shape(opt_op.type, key, var.shape, param_shape) tmpvar = program.global_block().create_var( @@ -412,30 +422,46 @@ class DistributeTranspiler: shape=new_shape) # change output's ParamOut variable - opt_op.outputs["ParamOut"] = new_inputs["Param"] + outputs = self._get_output_map_from_op(program.global_block(), opt_op) + outputs["ParamOut"] = new_inputs["Param"] program.global_block().append_op( type=opt_op.type, inputs=new_inputs, - outputs=opt_op.outputs, + outputs=outputs, attrs=opt_op.attrs) def _append_pserver_non_opt_ops(self, program, pserver_program, opt_op): # Append the ops for parameters that do not need to be optimized/updated - for _, var in opt_op.inputs.iteritems(): - program.global_block().create_var( - name=var.name, - persistable=var.persistable, - dtype=var.dtype, - shape=var.shape) - pserver_program.global_block().create_var( - name=var.name, - persistable=var.persistable, - dtype=var.dtype, - shape=var.shape) + inputs = self._get_input_map_from_op(self.program.global_block().vars, + opt_op) + for var in inputs.itervalues(): + if type(var) == list: + varlist = var + else: + varlist = [var] + for var in varlist: + program.global_block().create_var( + name=var.name, + persistable=var.persistable, + dtype=var.dtype, + shape=var.shape) + try: + pserver_program.global_block().create_var( + name=var.name, + persistable=var.persistable, + dtype=var.dtype, + shape=var.shape) + except ValueError: + # create var if not created yet. + pass + + outputs = self._get_output_map_from_op(self.program.global_block().vars, + opt_op) + program.global_block().append_op( type=opt_op.type, - inputs=opt_op.inputs, - outputs=opt_op.outputs, + inputs=inputs, + outputs=outputs, attrs=opt_op.attrs) def get_pserver_program(self, endpoint): @@ -472,7 +498,7 @@ class DistributeTranspiler: self.optimize_ops, idx) if not is_op_on_pserver: continue - if opt_op.inputs.has_key("Grad"): + if "Grad" in opt_op.desc.input_arg_names(): self._append_pserver_ops(optimize_sub_program, pserver_program, opt_op, endpoint) else: @@ -499,6 +525,30 @@ class DistributeTranspiler: pserver_program.sync_with_cpp() return pserver_program + def _get_input_map_from_op(self, varmap, op): + iomap = dict() + for key in op.input_names: + vars = [] + for varname in op.input(key): + vars.append(varmap[varname]) + if len(vars) == 1: + iomap[key] = vars[0] + else: + iomap[key] = vars + return iomap + + def _get_output_map_from_op(self, varmap, op): + iomap = dict() + for key in op.output_names: + vars = [] + for varname in op.output(key): + vars.append(varmap[varname]) + if len(vars) == 1: + iomap[key] = vars[0] + else: + iomap[key] = vars + return iomap + def get_startup_program(self, endpoint, pserver_program): """ Get startup program for current parameter server. @@ -529,17 +579,21 @@ class DistributeTranspiler: # 2. rename op outputs for op in orig_s_prog.global_block().ops: + new_inputs = dict() new_outputs = dict() # do not append startup op if var is not on this pserver op_on_pserver = False - for key, var in op.outputs.iteritems(): - newname, _ = _get_splited_name_and_shape(var.name) + for key in op.output_names: + newname, _ = _get_splited_name_and_shape(op.output(key)[0]) if newname: op_on_pserver = True new_outputs[key] = created_var_map[newname] - elif var.name in pserver_vars: + elif op.output(key)[0] in pserver_vars: op_on_pserver = True - new_outputs[key] = pserver_vars[var.name] + new_outputs[key] = pserver_vars[op.output(key)[0]] + + # most startup program ops have no inputs + new_inputs = self._get_input_map_from_op(pserver_vars, op) if op_on_pserver: if op.type in [ @@ -548,7 +602,7 @@ class DistributeTranspiler: op.attrs["shape"] = new_outputs["Out"].shape s_prog.global_block().append_op( type=op.type, - inputs=op.inputs, + inputs=new_inputs, outputs=new_outputs, attrs=op.attrs) return s_prog -- GitLab From 7a6000a0b879719ea25e4c882ae6be79845ee57f Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Thu, 8 Feb 2018 12:08:13 +0800 Subject: [PATCH 17/55] follow comments --- python/paddle/v2/fluid/distribute_transpiler.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/paddle/v2/fluid/distribute_transpiler.py b/python/paddle/v2/fluid/distribute_transpiler.py index 4eb103cc6ba..c5f1d51bd71 100644 --- a/python/paddle/v2/fluid/distribute_transpiler.py +++ b/python/paddle/v2/fluid/distribute_transpiler.py @@ -385,7 +385,7 @@ class DistributeTranspiler: # param is already created on global program param_block = None for p in self.param_grad_ep_mapping[endpoint]["params"]: - if same_or_split_var(p.name, opt_op.input(key)): + if same_or_split_var(p.name, opt_op.input(key)[0]): param_block = p break if not param_block: @@ -403,7 +403,7 @@ class DistributeTranspiler: continue # update accumulator variable shape param_shape = new_inputs["Param"].shape - var = program.global_block().vars[opt_op.input(key)] + var = program.global_block().vars[opt_op.input(key)[0]] new_shape = self._get_optimizer_input_shape(opt_op.type, key, var.shape, param_shape) tmpvar = program.global_block().create_var( @@ -440,20 +440,18 @@ class DistributeTranspiler: else: varlist = [var] for var in varlist: + # TODO(typhoonzero): will remove below line later. program.global_block().create_var( name=var.name, persistable=var.persistable, dtype=var.dtype, shape=var.shape) - try: + if not pserver_program.global_block().vars.has_key(var.name): pserver_program.global_block().create_var( name=var.name, persistable=var.persistable, dtype=var.dtype, shape=var.shape) - except ValueError: - # create var if not created yet. - pass outputs = self._get_output_map_from_op(self.program.global_block().vars, opt_op) -- GitLab From d9edd6efdcdde25057ccfb90aa0bed223ea74449 Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Thu, 8 Feb 2018 16:53:22 +0800 Subject: [PATCH 18/55] refine error msg and add unittest for cpp reader --- python/paddle/v2/fluid/executor.py | 29 +++--------- .../paddle/v2/fluid/tests/test_cpp_reader.py | 44 ++++++++++++------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/python/paddle/v2/fluid/executor.py b/python/paddle/v2/fluid/executor.py index 0eddcc3a5ab..01cbdb3ec48 100644 --- a/python/paddle/v2/fluid/executor.py +++ b/python/paddle/v2/fluid/executor.py @@ -47,27 +47,13 @@ def as_numpy(tensor): return [as_numpy(t) for t in tensor] assert isinstance(tensor, core.LoDTensor) lod = tensor.lod() - tensor_data = np.array(tensor) - if len(lod) == 0: - ans = tensor_data - else: - raise RuntimeError("LoD Calculate lacks unit tests and buggy") - # elif len(lod) == 1: - # ans = [] - # idx = 0 - # while idx < len(lod) - 1: - # ans.append(tensor_data[lod[idx]:lod[idx + 1]]) - # idx += 1 - # else: - # for l in reversed(lod): - # ans = [] - # idx = 0 - # while idx < len(l) - 1: - # ans.append(tensor_data[l[idx]:l[idx + 1]]) - # idx += 1 - # tensor_data = ans - # ans = tensor_data - return ans + if len(lod) > 0: + raise RuntimeError( + "Some of your featched tensors hold LoD information. \ + They can not be completely cast to Python ndarray. \ + Please set the parameter 'return_numpy' as 'False' to \ + return LoDTensor itself directly.") + return np.array(tensor) def has_feed_operators(block, feed_targets, feed_holder_name): @@ -306,7 +292,6 @@ class Executor(object): core.get_fetch_variable(scope, fetch_var_name, i) for i in xrange(len(fetch_list)) ] - if return_numpy: outs = as_numpy(outs) return outs diff --git a/python/paddle/v2/fluid/tests/test_cpp_reader.py b/python/paddle/v2/fluid/tests/test_cpp_reader.py index e71c3a290c9..970f57ed000 100644 --- a/python/paddle/v2/fluid/tests/test_cpp_reader.py +++ b/python/paddle/v2/fluid/tests/test_cpp_reader.py @@ -32,31 +32,43 @@ create_random_data_generator_op = block.append_op( "min": 0.0, "max": 1.0 }) +shuffle_reader = block.create_var( + type=fluid.core.VarDesc.VarType.READER, name="ShuffleReader") +shuffle_reader.desc.set_lod_levels([0, 0]) -out1 = block.create_var( - type=fluid.core.VarDesc.VarType.LOD_TENSOR, - name="Out1", - shape=[10, 2], - dtype="float32", - lod_level=1) -out2 = block.create_var( - type=fluid.core.VarDesc.VarType.LOD_TENSOR, - name="Out2", - shape=[10, 1], - dtype="float32", - lod_level=1) +create_shuffle_reader_op = block.append_op( + type="create_shuffle_reader", + inputs={"UnderlyingReader": random_reader}, + outputs={"Out": shuffle_reader}, + attrs={"buffer_size": 7}) + +batch_reader = block.create_var( + type=fluid.core.VarDesc.VarType.READER, name="BatchReader") +batch_reader.desc.set_lod_levels([1, 1]) + +create_batch_reader_op = block.append_op( + type="create_batch_reader", + inputs={"UnderlyingReader": shuffle_reader}, + outputs={"Out": batch_reader}, + attrs={"batch_size": 10}) + +out1 = block.create_var(type=fluid.core.VarDesc.VarType.LOD_TENSOR, name="Out1") +out2 = block.create_var(type=fluid.core.VarDesc.VarType.LOD_TENSOR, name="Out2") read_op = block.append_op( - type="read", - inputs={"Reader": random_reader}, + type="read", inputs={"Reader": batch_reader}, outputs={"Out": [out1, out2]}) place = fluid.CPUPlace() exe = fluid.Executor(place) -[res1, res2] = exe.run(prog, fetch_list=[out1, out2]) +[res1, res2] = exe.run(prog, fetch_list=[out1, out2], return_numpy=False) + +test_pass = res1.lod() == [range(0, 11)] and res1.lod() == [ + range(0, 11) +] and np.array(res1).shape == (10, 2) and np.array(res2).shape == (10, 1) -if len(res1) == 0 or len(res2) == 0: +if not test_pass: exit(1) exit(0) -- GitLab From e4d9989af0ab4d49d5b04dc95834cbac20c9eed0 Mon Sep 17 00:00:00 2001 From: Liu Yiqun Date: Thu, 8 Feb 2018 09:32:28 +0000 Subject: [PATCH 19/55] Simplify the cmake of inference. --- cmake/generic.cmake | 14 +++++++++----- paddle/inference/CMakeLists.txt | 15 +++++---------- paddle/inference/tests/book/CMakeLists.txt | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/cmake/generic.cmake b/cmake/generic.cmake index 33ef6860e1d..1cb54ba2164 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -179,20 +179,24 @@ function(cc_library TARGET_NAME) set(oneValueArgs "") set(multiValueArgs SRCS DEPS) cmake_parse_arguments(cc_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if (cc_library_SRCS) - if (cc_library_SHARED OR cc_library_shared) # build *.so + if(cc_library_SRCS) + if(cc_library_SHARED OR cc_library_shared) # build *.so add_library(${TARGET_NAME} SHARED ${cc_library_SRCS}) else() add_library(${TARGET_NAME} STATIC ${cc_library_SRCS}) endif() - if (cc_library_DEPS) + if(cc_library_DEPS) # Don't need link libwarpctc.so - if ("${cc_library_DEPS};" MATCHES "warpctc;") + if("${cc_library_DEPS};" MATCHES "warpctc;") list(REMOVE_ITEM cc_library_DEPS warpctc) add_dependencies(${TARGET_NAME} warpctc) endif() + # Support linking flags: --whole-archive (Linux) / -force_load (MacOS) + target_circle_link_libraries(${TARGET_NAME} ${cc_library_DEPS}) + if("${cc_library_DEPS}" MATCHES "ARCHIVE_START") + list(REMOVE_ITEM cc_library_DEPS ARCHIVE_START ARCHIVE_END) + endif() add_dependencies(${TARGET_NAME} ${cc_library_DEPS}) - target_link_libraries(${TARGET_NAME} ${cc_library_DEPS}) endif() # cpplint code style diff --git a/paddle/inference/CMakeLists.txt b/paddle/inference/CMakeLists.txt index 654a6119bdc..bdb147955ca 100644 --- a/paddle/inference/CMakeLists.txt +++ b/paddle/inference/CMakeLists.txt @@ -4,19 +4,14 @@ cc_library(paddle_fluid_api SRCS io.cc DEPS ${FLUID_CORE_MODULES} ${GLOB_OP_LIB}) -# Merge all modules into a single static library +# Create static library cc_library(paddle_fluid DEPS paddle_fluid_api ${FLUID_CORE_MODULES} ${GLOB_OP_LIB}) # Create shared library -add_library(paddle_fluid_shared SHARED io.cc) - -target_circle_link_libraries(paddle_fluid_shared - ARCHIVE_START - ${GLOB_OP_LIB} - ${FLUID_CORE_MODULES} - ARCHIVE_END) - -SET_TARGET_PROPERTIES(paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid) +cc_library(paddle_fluid_shared SHARED + SRCS io.cc + DEPS ARCHIVE_START ${GLOB_OP_LIB} ${FLUID_CORE_MODULES} ARCHIVE_END) +set_target_properties(paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid) if(WITH_TESTING) add_subdirectory(tests/book) diff --git a/paddle/inference/tests/book/CMakeLists.txt b/paddle/inference/tests/book/CMakeLists.txt index 63afeb18aeb..124e0fb9ba6 100644 --- a/paddle/inference/tests/book/CMakeLists.txt +++ b/paddle/inference/tests/book/CMakeLists.txt @@ -5,23 +5,23 @@ function(inference_test TARGET_NAME) cmake_parse_arguments(inference_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(PYTHON_TESTS_DIR ${PADDLE_SOURCE_DIR}/python/paddle/v2/fluid/tests) + set(arg_list "") if(inference_test_ARGS) foreach(arg ${inference_test_ARGS}) - cc_test(test_inference_${TARGET_NAME}_${arg} - SRCS test_inference_${TARGET_NAME}.cc - DEPS ARCHIVE_START paddle_fluid ARCHIVE_END - ARGS --dirname=${PYTHON_TESTS_DIR}/book/${TARGET_NAME}_${arg}.inference.model) - set_tests_properties(test_inference_${TARGET_NAME}_${arg} - PROPERTIES DEPENDS test_${TARGET_NAME}) + list(APPEND arg_list "_${arg}") endforeach() else() - cc_test(test_inference_${TARGET_NAME} + list(APPEND arg_list "_") + endif() + foreach(arg ${arg_list}) + string(REGEX REPLACE "^_$" "" arg "${arg}") + cc_test(test_inference_${TARGET_NAME}${arg} SRCS test_inference_${TARGET_NAME}.cc DEPS ARCHIVE_START paddle_fluid ARCHIVE_END - ARGS --dirname=${PYTHON_TESTS_DIR}/book/${TARGET_NAME}.inference.model) - set_tests_properties(test_inference_${TARGET_NAME} + ARGS --dirname=${PYTHON_TESTS_DIR}/book/${TARGET_NAME}${arg}.inference.model) + set_tests_properties(test_inference_${TARGET_NAME}${arg} PROPERTIES DEPENDS test_${TARGET_NAME}) - endif() + endforeach() endfunction(inference_test) inference_test(recognize_digits ARGS mlp) -- GitLab From 7c880522542093e0ae23c49e3ed24e3c4100d3e1 Mon Sep 17 00:00:00 2001 From: Yancey1989 Date: Thu, 8 Feb 2018 19:51:20 +0800 Subject: [PATCH 20/55] Optimize return all opt ops --- python/paddle/v2/fluid/framework.py | 3 + python/paddle/v2/fluid/optimizer.py | 15 ++--- .../paddle/v2/fluid/tests/test_optimizer.py | 56 ++++++++++--------- 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/python/paddle/v2/fluid/framework.py b/python/paddle/v2/fluid/framework.py index a12427258e9..a517db68c58 100644 --- a/python/paddle/v2/fluid/framework.py +++ b/python/paddle/v2/fluid/framework.py @@ -740,6 +740,9 @@ class Block(object): raise e self.desc.remove_op(start, end + 1) + def slice_ops(self, start, end): + return list(self.ops)[start:end] + def prepend_op(self, *args, **kwargs): op_desc = self.desc.prepend_op() op = Operator(self, op_desc, *args, **kwargs) diff --git a/python/paddle/v2/fluid/optimizer.py b/python/paddle/v2/fluid/optimizer.py index 7844a4e2df1..f8a00e3a5fb 100644 --- a/python/paddle/v2/fluid/optimizer.py +++ b/python/paddle/v2/fluid/optimizer.py @@ -190,6 +190,8 @@ class Optimizer(object): # Create any accumulators program = loss.block.program with program_guard(program, startup_program): + global_block = framework.default_main_program().global_block() + start = len(global_block.ops) self.helper = LayerHelper(self.__class__.__name__) self._create_accumulators(loss.block, [p[0] for p in parameters_and_grads]) @@ -203,19 +205,14 @@ class Optimizer(object): param_and_grad) optimize_ops.append(optimize_op) - # Returned list of ops can include more ops in addition - # to optimization ops - return_ops = optimize_ops - # Get custom finish ops for subclasses # FIXME: Need to fix this once we figure out how to handle dependencies - finish_ops = self._finish_update(loss.block) - if finish_ops is not None: - return_ops += finish_ops + self._finish_update(loss.block) if self._global_step is not None: - return_ops.append(self._increment_global_step(loss.block)) - return return_ops + self._increment_global_step(loss.block) + end = len(global_block.ops) + return global_block.slice_ops(start, end) def minimize(self, loss, diff --git a/python/paddle/v2/fluid/tests/test_optimizer.py b/python/paddle/v2/fluid/tests/test_optimizer.py index 480ee709157..dc6b84dcdc0 100644 --- a/python/paddle/v2/fluid/tests/test_optimizer.py +++ b/python/paddle/v2/fluid/tests/test_optimizer.py @@ -42,9 +42,9 @@ class TestOptimizer(unittest.TestCase): type="mean", inputs={"X": mul_out}, outputs={"Out": mean_out}) sgd_optimizer = optimizer.SGDOptimizer(learning_rate=0.01) opts, _ = sgd_optimizer.minimize(mean_out, init_program) - self.assertEqual(len(opts), 1) - sgd_op = opts[0] - self.assertEqual(sgd_op.type, "sgd") + self.assertEqual(len(opts), 3) + self.assertEqual([op.type for op in opts], + ["fill_constant", "elementwise_mul", "sgd"]) def test_sgd_optimizer_with_global_step(self): init_program = framework.Program() @@ -72,11 +72,10 @@ class TestOptimizer(unittest.TestCase): sgd_optimizer = optimizer.SGDOptimizer( learning_rate=learning_rate, global_step=global_step) opts, _ = sgd_optimizer.minimize(mean_out, init_program) - self.assertEqual(len(opts), 2) - sgd_op = opts[0] - self.assertEqual(sgd_op.type, "sgd") - increment_op = opts[1] - self.assertEqual(increment_op.type, "increment") + self.assertEqual(len(opts), 4) + self.assertEqual( + [op.type for op in opts], + ["fill_constant", "elementwise_mul", "sgd", "increment"]) # Check init_program init_ops = init_program.global_block().ops @@ -121,9 +120,10 @@ class TestMomentumOptimizer(unittest.TestCase): self.assertEqual(len(momentum_optimizer.get_accumulators()), 0) opts = momentum_optimizer.create_optimization_pass( params_grads, mul_out, init_program) - self.assertEqual(len(opts), 1) - sgd_op = opts[0] - self.assertEqual(sgd_op.type, "momentum") + self.assertEqual(len(opts), 3) + sgd_op = opts[-1] + self.assertEqual([op.type for op in opts], + ["fill_constant", "elementwise_mul", "momentum"]) self.assertFalse(sgd_op.attr('use_nesterov')) # Check accumulators @@ -170,9 +170,10 @@ class TestMomentumOptimizer(unittest.TestCase): self.assertEqual(len(momentum_optimizer.get_accumulators()), 0) opts = momentum_optimizer.create_optimization_pass( params_grads, mul_out, init_program) - self.assertEqual(len(opts), 1) - sgd_op = opts[0] - self.assertEqual(sgd_op.type, "momentum") + self.assertEqual(len(opts), 3) + sgd_op = opts[-1] + self.assertEqual([op.type for op in opts], + ["fill_constant", "elementwise_mul", "momentum"]) self.assertTrue(sgd_op.attr('use_nesterov')) # Check accumulators @@ -228,9 +229,9 @@ class TestAdagradOptimizer(unittest.TestCase): self.assertEqual(len(adagrad_optimizer.get_accumulators()), 0) opts = adagrad_optimizer.create_optimization_pass(params_grads, mul_out, init_program) - self.assertEqual(len(opts), 1) - adagrad_op = opts[0] - self.assertEqual(adagrad_op.type, "adagrad") + self.assertEqual(len(opts), 3) + self.assertEqual([op.type for op in opts], + ["fill_constant", "elementwise_mul", "adagrad"]) # Check accumulators accumulators = adagrad_optimizer.get_accumulators() @@ -288,9 +289,10 @@ class TestAdamOptimizer(unittest.TestCase): self.assertEqual(len(adam_optimizer.get_accumulators()), 0) opts = adam_optimizer.create_optimization_pass(params_grads, mul_out, init_program) - self.assertEqual(len(opts), 3) - adam_op = opts[0] - self.assertEqual(adam_op.type, "adam") + self.assertEqual(len(opts), 5) + self.assertEqual( + [op.type for op in opts], + ["fill_constant", "elementwise_mul", "adam", "scale", "scale"]) # Check accumulators accumulators = adam_optimizer.get_accumulators() @@ -350,9 +352,10 @@ class TestAdamaxOptimizer(unittest.TestCase): self.assertEqual(len(adamax_optimizer.get_accumulators()), 0) opts = adamax_optimizer.create_optimization_pass(params_grads, mul_out, init_program) - self.assertEqual(len(opts), 2) - adam_op = opts[0] - self.assertEqual(adam_op.type, "adamax") + self.assertEqual(len(opts), 4) + self.assertEqual( + [op.type for op in opts], + ["fill_constant", "elementwise_mul", "adamax", "scale"]) # Check accumulators accumulators = adamax_optimizer.get_accumulators() @@ -409,9 +412,10 @@ class TestDecayedAdagradOptimizer(unittest.TestCase): self.assertEqual(len(decayed_adagrad_optimizer.get_accumulators()), 0) opts = decayed_adagrad_optimizer.create_optimization_pass( params_grads, mul_out, init_program) - self.assertEqual(len(opts), 1) - decayed_adagrad_op = opts[0] - self.assertEqual(decayed_adagrad_op.type, "decayed_adagrad") + self.assertEqual(len(opts), 3) + self.assertEqual( + [op.type for op in opts], + ["fill_constant", "elementwise_mul", "decayed_adagrad"]) # Check accumulators accumulators = decayed_adagrad_optimizer.get_accumulators() -- GitLab From ef1aba39a6cadaadc133e9370e5b610596c42cc6 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Thu, 8 Feb 2018 17:50:16 +0800 Subject: [PATCH 21/55] Rewrite mixed_vector.h --- .gitignore | 6 + cmake/cuda.cmake | 3 +- paddle/framework/lod_tensor.h | 24 +- paddle/framework/lod_tensor_test.cu | 9 +- paddle/framework/mixed_vector.h | 399 ++++++++++++------ paddle/framework/mixed_vector_test.cu | 59 --- paddle/framework/tensor.h | 4 + paddle/framework/tensor_impl.h | 2 +- paddle/operators/adagrad_op.cu | 6 +- paddle/operators/adam_op.h | 2 +- paddle/operators/ctc_align_op.cu | 5 +- paddle/operators/lookup_table_op.cu | 4 +- .../operators/math/selected_rows_functor.cc | 2 +- .../operators/math/selected_rows_functor.cu | 15 +- paddle/operators/math/sequence2batch.cu | 4 +- paddle/operators/math/sequence_padding.cu | 8 +- paddle/operators/math/sequence_pooling.cu | 3 +- paddle/operators/math/sequence_scale.cu | 3 +- paddle/operators/parallel_do_op.cc | 9 - paddle/operators/row_conv_op.cu | 4 +- paddle/operators/sequence_erase_op.cu | 3 +- paddle/operators/sgd_op.cu | 4 +- paddle/operators/target_assign_op.h | 4 +- paddle/testing/paddle_gtest_main.cc | 2 +- 24 files changed, 316 insertions(+), 268 deletions(-) diff --git a/.gitignore b/.gitignore index ac56a3320ec..59e650bdfe8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ +paddle/operators/check_t.save +paddle/operators/check_tensor.ls +paddle/operators/tensor.save +python/paddle/v2/fluid/tests/book/image_classification_resnet.inference.model/ +python/paddle/v2/fluid/tests/book/image_classification_vgg.inference.model/ +python/paddle/v2/fluid/tests/book/label_semantic_roles.inference.model/ *.DS_Store build/ build_doc/ diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 6bea7cf3022..de94bd5008e 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -181,7 +181,8 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release") elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") list(APPEND CUDA_NVCC_FLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") - list(APPEND CUDA_NVCC_FLAGS ${CMAKE_CXX_FLAGS_MINSIZEREL}) + # nvcc 9 does not support -Os. Use Release flags instead + list(APPEND CUDA_NVCC_FLAGS ${CMAKE_CXX_FLAGS_RELEASE}) endif() mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_VERBOSE_BUILD) diff --git a/paddle/framework/lod_tensor.h b/paddle/framework/lod_tensor.h index be2b3016196..9de454428d9 100644 --- a/paddle/framework/lod_tensor.h +++ b/paddle/framework/lod_tensor.h @@ -46,29 +46,7 @@ namespace framework { * 0 2 4 7 * 0 2 5 7 10 12 15 20 */ -struct LoD : public std::vector> { - using std::vector>::vector; - platform::Place place() const { - if (this->size() == 0) { - // Not Initialze Yet. - return platform::CPUPlace(); - } else { - return this->front().place(); - } - } - - void CopyFromCUDA() { - for (auto it = this->begin(); it != this->end(); ++it) { - it->CopyFromCUDA(); - } - } - - void CopyToPeer(platform::Place place) { - for (auto it = this->begin(); it != this->end(); ++it) { - it->CopyToPeer(place); - } - } -}; +using LoD = std::vector>; std::ostream& operator<<(std::ostream& os, const LoD& lod); std::ostream& operator<<(std::ostream& os, const LoDTensor& t); diff --git a/paddle/framework/lod_tensor_test.cu b/paddle/framework/lod_tensor_test.cu index adea02e3b3f..a28b7caf86c 100644 --- a/paddle/framework/lod_tensor_test.cu +++ b/paddle/framework/lod_tensor_test.cu @@ -20,6 +20,7 @@ #include "paddle/platform/assert.h" #include +#include __global__ void test(size_t* a, int size) { for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < size; @@ -36,10 +37,9 @@ TEST(LoD, data) { lod.push_back(std::vector({0, 1, 6, 8, 10, 11})); auto& v = lod[0]; - test<<<1, 1>>>(v.cuda_data(), v.size()); + paddle::platform::CUDAPlace gpu(0); + test<<<1, 1>>>(v.CUDAMutableData(gpu), v.size()); cudaDeviceSynchronize(); - - v.CopyFromCUDA(); for (size_t i = 0; i < v.size(); ++i) { EXPECT_EQ(v[i], i * 2); } @@ -63,9 +63,8 @@ TEST(LoDTensor, LoDInGPU) { auto lod = lod_tensor.lod(); - test<<<1, 8>>>(lod[0].cuda_data(), lod[0].size()); + test<<<1, 8>>>(lod[0].CUDAMutableData(place), lod[0].size()); cudaDeviceSynchronize(); - lod.CopyFromCUDA(); for (size_t i = 0; i < src_lod[0].size(); ++i) { EXPECT_EQ(lod[0].data()[i], src_lod[0].data()[i] * 2); diff --git a/paddle/framework/mixed_vector.h b/paddle/framework/mixed_vector.h index 5202775515d..2a80079695f 100644 --- a/paddle/framework/mixed_vector.h +++ b/paddle/framework/mixed_vector.h @@ -17,176 +17,297 @@ #include #include -#include "paddle/memory/memcpy.h" -#include "paddle/memory/memory.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/place.h" +#include "paddle/framework/tensor.h" +#include "paddle/framework/tensor_util.h" + +#include "glog/logging.h" namespace paddle { namespace framework { -/** - * @brief Vector support both cpu and gpu. - * host vector lifetime is same with Vector - * device vector is lazily malloc and modified. - */ - template -class Vector : public std::vector { +class Vector { public: - using std::vector::vector; + using value_type = T; + + Vector() { + size_ = 0; + flag_ = kDataInCPU; + } + + explicit Vector(size_t count, const T& value = T()) { + resize(count); + T* ptr = begin(); + for (size_t i = 0; i < count; ++i) { + ptr[i] = value; + } + } + + Vector(std::initializer_list init) { + InitByIter(init.size(), init.begin(), init.end()); + } + + template + Vector(const std::vector& dat) { // NOLINT + InitByIter(dat.size(), dat.begin(), dat.end()); + } + + Vector(const Vector& other) { this->operator=(other); } + + Vector& operator=(const Vector& other) { + if (other.size() != 0) { + this->InitByIter(other.size(), other.begin(), other.end()); + } else { + size_ = 0; + flag_ = kDataInCPU; + } + return *this; + } + + Vector(Vector&& other) { + this->size_ = other.size_; + this->flag_ = other.flag_; + if (other.cuda_vec_.capacity()) { + this->cuda_vec_.ShareDataWith(other.cuda_vec_); + } + if (other.cpu_vec_.capacity()) { + this->cpu_vec_.ShareDataWith(other.cpu_vec_); + } + } - Vector() {} - Vector(const std::vector &v) : std::vector(v) {} // NOLINT + T& operator[](size_t i) { + MutableCPU(); + return const_cast(cpu_vec_.data())[i]; + } + + const T& operator[](size_t i) const { + ImmutableCPU(); + return cpu_vec_.data()[i]; + } + + size_t size() const { return size_; } + + T* begin() { return &this->operator[](0); } + + T* end() { return &this->operator[](size()); } + + T& front() { return *begin(); } + + T& back() { + auto it = end(); + --it; + return *it; + } + + const T* begin() const { return &this->operator[](0); } + const T* end() const { return &this->operator[](size()); } - inline platform::Place place() const { return place_; } + const T& back() const { + auto it = end(); + --it; + return *it; + } + + const T& front() const { return *begin(); } + + template + void assign(Iter begin, Iter end) { + InitByIter(end - begin, begin, end); + } + + T* data() { return begin(); } - /*! Return a pointer to constant memory block. */ - inline const T *data(platform::Place place) const; + const T* data() const { return begin(); } - /*! Return a pointer to mutable memory block. */ - inline T *mutable_data(platform::Place place); + void push_back(T elem) { + if (size_ + 1 > capacity()) { + reserve((size_ + 1) << 1); + } + *end() = elem; + ++size_; + } - // TODO(dzhwinter): below interfaces should be removed - /* Get device vector */ - T *cuda_data() { - CopyToCUDA(); - PADDLE_ENFORCE_NOT_NULL( - cuda_ptr_, "No data or Insufficient CUDA memory to allocation"); - return static_cast(cuda_ptr_.get()); + void resize(size_t size) { + if (size + 1 < capacity()) { + size_ = size; + } else { + MutableCPU(); + Tensor cpu_tensor; + platform::Place cpu = platform::CPUPlace(); + T* ptr = cpu_tensor.mutable_data( + framework::make_ddim({static_cast(size)}), cpu); + const T* old_ptr = + cpu_vec_.capacity() == 0 ? nullptr : cpu_vec_.data(); + if (old_ptr != nullptr) { + std::copy(old_ptr, old_ptr + size_, ptr); + } + size_ = size; + cpu_vec_.ShareDataWith(cpu_tensor); + } } - /* Get host vector */ - T *data() { return std::vector::data(); } - const T *data() const { return std::vector::data(); } + const T* CUDAData(platform::Place place) const { + PADDLE_ENFORCE(platform::is_gpu_place(place), + "CUDA Data must on CUDA place"); + ImmutableCUDA(place); + return cuda_vec_.data(); + } - T *data(const platform::Place &place) { - if (platform::is_cpu_place(place)) { + T* CUDAMutableData(platform::Place place) { + const T* ptr = CUDAData(place); + flag_ = kDirty | kDataInCUDA; + return const_cast(ptr); + } + + template + void Extend(It begin, It end) { + size_t pre_size = size_; + resize(pre_size + (end - begin)); + T* ptr = this->begin() + pre_size; + for (; begin < end; ++begin, ++ptr) { + *ptr = *begin; + } + } + + void clear() { + size_ = 0; + flag_ = kDirty | kDataInCPU; + } + + size_t capacity() const { + return cpu_vec_.capacity() / SizeOfType(typeid(T)); + } + + void reserve(size_t size) { + size_t pre_size = size_; + resize(size); + resize(pre_size); + } + + const T* Data(platform::Place place) const { + if (platform::is_gpu_place(place)) { + return CUDAData(place); + } else { return data(); + } + } + + T* MutableData(platform::Place place) { + if (platform::is_gpu_place(place)) { + return CUDAMutableData(place); } else { - return cuda_data(); + return data(); } } - /* Synchronize host vector to device vector */ - void CopyToCUDA(); - /* Synchronize device vector to host vector */ - void CopyFromCUDA(); - /* Switch device vector location */ - void CopyToPeer(platform::Place); + operator std::vector() const { + std::vector result; + result.resize(size()); + std::copy(begin(), end(), result.begin()); + return result; + } + + bool operator==(const Vector& other) const { + if (size() != other.size()) return false; + for (auto it1 = begin(), it2 = other.begin(); it1 < end(); ++it1, ++it2) { + if (*it1 != *it2) { + return false; + } + } + return true; + } private: - std::shared_ptr cuda_ptr_; - size_t cuda_size_ = 0; // device vector numel - platform::CUDAPlace place_; -}; + template + void InitByIter(size_t size, Iter begin, Iter end) { + platform::Place cpu = platform::CPUPlace(); + T* ptr = this->cpu_vec_.template mutable_data( + framework::make_ddim({static_cast(size)}), cpu); + for (size_t i = 0; i < size; ++i) { + *ptr++ = *begin++; + } + flag_ = kDataInCPU | kDirty; + size_ = size; + } -template -inline const T *Vector::data(platform::Place place) const { - if (platform::is_cpu_place(place)) { - return std::vector::data(); - } else if (platform::is_gpu_place(place)) { - if (cuda_ptr_ == nullptr) { - return nullptr; + enum DataFlag { kDataInCPU = 0x01, kDataInCUDA = 0x02, kDirty = 0x10 }; + + void MutableCPU() { + if (IsInCUDA() && IsDirty()) { + // COPY GPU Data To CPU + Copy(cuda_vec_, platform::CPUPlace(), &cpu_vec_); + WaitPlace(cuda_vec_.place()); } - if (boost::get(place) == place_) { - return static_cast(cuda_ptr_.get()); + flag_ = kDirty | kDataInCPU; + } + + void ImmutableCUDA(platform::Place place) const { + if (IsDirty()) { + if (IsInCPU()) { + Copy(cpu_vec_, boost::get(place), &cuda_vec_); + WaitPlace(place); + UnsetFlag(kDirty); + SetFlag(kDataInCUDA); + } else if (IsInCUDA() && !(place == cuda_vec_.place())) { + framework::Tensor tmp; + Copy(cuda_vec_, boost::get(place), &tmp); + WaitPlace(cuda_vec_.place()); + cuda_vec_.ShareDataWith(tmp); + // Still dirty + } else { + // Dirty && DataInCUDA && Device is same + // Do nothing + } } else { - PADDLE_THROW( - "Unmatched place. Please use `mutable_data` copy lod to the target " - "Place first."); + if (!IsInCUDA()) { + // Even data is not dirty. However, data is not in CUDA. Copy data. + Copy(cpu_vec_, boost::get(place), &cuda_vec_); + WaitPlace(place); + SetFlag(kDataInCUDA); + } else if (!(place == cuda_vec_.place())) { + framework::Tensor tmp; + Copy(cuda_vec_, boost::get(place), &tmp); + WaitPlace(cuda_vec_.place()); + cuda_vec_.ShareDataWith(tmp); + } else { + // Not Dirty && DataInCUDA && Device is same + // Do nothing. + } } - } else { - PADDLE_THROW("Unsupport Place."); } -} -template -inline T *Vector::mutable_data(platform::Place place) { - if (platform::is_cpu_place(place)) { - return std::vector::data(); - } else if (platform::is_gpu_place(place)) { - if (boost::get(place) != place_) { - place_ = boost::get(place); + void ImmutableCPU() const { + if (IsDirty() && + !IsInCPU()) { // If data has been changed in CUDA, or CPU has no data. + Copy(cuda_vec_, platform::CPUPlace(), &cpu_vec_); + WaitPlace(cuda_vec_.place()); + UnsetFlag(kDirty); } -#ifdef PADDLE_WITH_CUDA - if (cuda_size_ < this->size() || cuda_ptr_ == nullptr) { - cuda_ptr_.reset( - memory::Alloc(place_, this->size() * sizeof(T)), - memory::PlainDeleter(place_)); - } - cuda_size_ = this->size(); - platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); - auto *ctx = pool.GetByPlace(place_); - memory::Copy(place_, cuda_ptr_.get(), platform::CPUPlace(), - static_cast(this->data()), - this->size() * sizeof(T), ctx->stream()); - ctx->Wait(); - return static_cast(cuda_ptr_.get()); -#else - return nullptr; -#endif - } else { - PADDLE_THROW("Unsupport Place."); - } -} + SetFlag(kDataInCPU); + } -template -void Vector::CopyToCUDA() { -#ifdef PADDLE_WITH_CUDA - if (cuda_size_ < this->size() || cuda_ptr_ == nullptr) { - cuda_ptr_.reset( - memory::Alloc(place_, this->size() * sizeof(T)), - memory::PlainDeleter(place_)); - } - cuda_size_ = this->size(); - platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); - auto *ctx = pool.GetByPlace(place_); - memory::Copy(place_, cuda_ptr_.get(), platform::CPUPlace(), - static_cast(this->data()), - this->size() * sizeof(T), ctx->stream()); - ctx->Wait(); -#endif -} + void UnsetFlag(int flag) const { flag_ &= ~flag; } + void SetFlag(int flag) const { flag_ |= flag; } -template -void Vector::CopyFromCUDA() { -#ifdef PADDLE_WITH_CUDA - if (cuda_ptr_ == nullptr) { - LOG(WARNING) << "No uncommitted cuda data."; - return; - } - this->resize(cuda_size_); - platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); - auto *ctx = pool.GetByPlace(place_); - memory::Copy(platform::CPUPlace(), static_cast(this->data()), place_, - static_cast(cuda_ptr_.get()), - this->size() * sizeof(T), ctx->stream()); - ctx->Wait(); -#endif -} + bool IsDirty() const { return flag_ & kDirty; } -template -void Vector::CopyToPeer(platform::Place place) { -#ifdef PADDLE_WITH_CUDA - if (boost::get(place) != place_) { - place_ = boost::get(place); - } - if (cuda_size_ < this->size() || cuda_ptr_ == nullptr) { - cuda_ptr_.reset( - memory::Alloc(place_, this->size() * sizeof(T)), - memory::PlainDeleter(place_)); - } - cuda_size_ = this->size(); - platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); - auto *ctx = pool.GetByPlace(place_); - memory::Copy(place_, cuda_ptr_.get(), platform::CPUPlace(), - static_cast(this->data()), - this->size() * sizeof(T), ctx->stream()); - ctx->Wait(); -#endif -} + bool IsInCUDA() const { return flag_ & kDataInCUDA; } + + bool IsInCPU() const { return flag_ & kDataInCPU; } + + static void WaitPlace(const platform::Place place) { + if (platform::is_gpu_place(place)) { + platform::DeviceContextPool::Instance() + .Get(boost::get(place)) + ->Wait(); + } + } + + mutable int flag_; + mutable Tensor cpu_vec_; + mutable Tensor cuda_vec_; + size_t size_; +}; } // namespace framework } // namespace paddle diff --git a/paddle/framework/mixed_vector_test.cu b/paddle/framework/mixed_vector_test.cu index 7b571788ad1..6adad6c12c3 100644 --- a/paddle/framework/mixed_vector_test.cu +++ b/paddle/framework/mixed_vector_test.cu @@ -11,62 +11,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include -#include -#include "gtest/gtest.h" - -#include "paddle/framework/init.h" -#include "paddle/framework/mixed_vector.h" - -using namespace paddle::framework; -using namespace paddle::platform; -using namespace paddle::memory; - -template -__global__ void test(T* data, int size) { - for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < size; - i += blockDim.x * gridDim.x) { - data[i] *= 2; - } -} - -TEST(Vector, Normal) { - // fill the device context pool. - InitDevices(); - - Vector vec({1, 2, 3}); - size_t* ptr = vec.data(); - for (size_t i = 0; i < vec.size(); ++i) { - EXPECT_EQ(vec[i], *(ptr + i)); - } - - vec.clear(); - vec.CopyFromCUDA(); - - std::vector v = {1, 2, 3}; - for (size_t i = 0; i < v.size(); ++i) { - EXPECT_EQ(v[i], vec[i]); - } -} - -TEST(Vector, MultipleCopy) { - InitDevices(); - Vector vec({1, 2, 3}); - CUDAPlace place(0); - vec.mutable_data(place); - auto vec2 = Vector(vec); - { - const size_t* ptr = vec2.data(CPUPlace()); - for (size_t i = 0; i < vec2.size(); ++i) { - EXPECT_EQ(*(ptr + i), vec[i]); - } - } - test<<<3, 3>>>(vec2.mutable_data(place), vec2.size()); - vec2.CopyFromCUDA(); - { - const size_t* ptr = vec2.data(CPUPlace()); - for (size_t i = 0; i < vec2.size(); ++i) { - EXPECT_EQ(*(ptr + i), vec[i] * 2); - } - } -} diff --git a/paddle/framework/tensor.h b/paddle/framework/tensor.h index f0ea709a5c3..a8767a75430 100644 --- a/paddle/framework/tensor.h +++ b/paddle/framework/tensor.h @@ -128,6 +128,10 @@ class Tensor { inline void set_layout(const DataLayout layout) { layout_ = layout; } + size_t capacity() const { + return holder_ == nullptr ? 0UL : holder_->size() - offset_; + } + private: friend class LoDTensor; diff --git a/paddle/framework/tensor_impl.h b/paddle/framework/tensor_impl.h index 1340c5e4852..6dcaa024245 100644 --- a/paddle/framework/tensor_impl.h +++ b/paddle/framework/tensor_impl.h @@ -52,7 +52,7 @@ struct SizeOfTypeFunctor { }; static inline size_t SizeOfType(std::type_index type) { - SizeOfTypeFunctor functor; + SizeOfTypeFunctor functor; size_t size = functor(type); PADDLE_ENFORCE(size != 0UL, "Cannot get size of type %s", type.name()); return size; diff --git a/paddle/operators/adagrad_op.cu b/paddle/operators/adagrad_op.cu index 00cb6e9cafb..9a21e00b12b 100644 --- a/paddle/operators/adagrad_op.cu +++ b/paddle/operators/adagrad_op.cu @@ -101,9 +101,9 @@ struct SparseAdagradFunctor { SparseAdagradFunctorKernel< T, 256><<(context) - .stream()>>>(grad_merge_data, merge_rows.cuda_data(), lr, - param_data, moment_data, grad_width, - epsilon); + .stream()>>>( + grad_merge_data, merge_rows.CUDAMutableData(context.GetPlace()), lr, + param_data, moment_data, grad_width, epsilon); } }; diff --git a/paddle/operators/adam_op.h b/paddle/operators/adam_op.h index bf536687d39..af2c3ecd725 100644 --- a/paddle/operators/adam_op.h +++ b/paddle/operators/adam_op.h @@ -201,7 +201,7 @@ class AdamOpKernel : public framework::OpKernel { const T* grad_data = grad_tensor.template data(); int64_t* rows = nullptr; if (platform::is_gpu_place(ctx.GetPlace())) { - rows = grad_merge.mutable_rows()->cuda_data(); + rows = grad_merge.mutable_rows()->CUDAMutableData(ctx.GetPlace()); } else { rows = grad_merge.mutable_rows()->data(); } diff --git a/paddle/operators/ctc_align_op.cu b/paddle/operators/ctc_align_op.cu index cea595d7c5d..6406825d4a5 100644 --- a/paddle/operators/ctc_align_op.cu +++ b/paddle/operators/ctc_align_op.cu @@ -69,8 +69,9 @@ class CTCAlignOpCUDAKernel : public framework::OpKernel { auto stream = ctx.cuda_device_context().stream(); MergeAndDelCudaKernel<<<1, 1, 0, stream>>>( - num_tokens, tokens, num_seq, input_lod[level].cuda_data(), blank, - merge_repeated, dev_out_lod0_ptr, output_data); + num_tokens, tokens, num_seq, + input_lod[level].CUDAMutableData(ctx.GetPlace()), blank, merge_repeated, + dev_out_lod0_ptr, output_data); // set output lod std::vector host_out_lod0(dev_out_lod0.begin(), dev_out_lod0.end()); diff --git a/paddle/operators/lookup_table_op.cu b/paddle/operators/lookup_table_op.cu index 07372808bbf..9684b6d4612 100644 --- a/paddle/operators/lookup_table_op.cu +++ b/paddle/operators/lookup_table_op.cu @@ -125,7 +125,9 @@ class LookupTableGradCUDAKernel : public framework::OpKernel { new_rows.resize(ids_dim[0]); auto gpu_place = boost::get(context.GetPlace()); - memory::Copy(platform::CPUPlace(), new_rows.cuda_data(), gpu_place, + // TODO(yuyang18): Strange code here. + memory::Copy(platform::CPUPlace(), + new_rows.CUDAMutableData(context.GetPlace()), gpu_place, ids_data, ids_dim[0] * sizeof(int64_t), stream); d_table->set_rows(new_rows); diff --git a/paddle/operators/math/selected_rows_functor.cc b/paddle/operators/math/selected_rows_functor.cc index 8a1ebb58c26..4e15d01a307 100644 --- a/paddle/operators/math/selected_rows_functor.cc +++ b/paddle/operators/math/selected_rows_functor.cc @@ -128,7 +128,7 @@ struct SelectedRowsAddTo { auto* in2_value = input2->mutable_value(); // concat rows - in2_rows.insert(in2_rows.end(), in1_rows.begin(), in1_rows.end()); + in2_rows.Extend(in1_rows.begin(), in1_rows.end()); auto in1_place = input1.place(); PADDLE_ENFORCE(platform::is_cpu_place(in1_place)); diff --git a/paddle/operators/math/selected_rows_functor.cu b/paddle/operators/math/selected_rows_functor.cu index acdd87cb355..5c3a53ae1ba 100644 --- a/paddle/operators/math/selected_rows_functor.cu +++ b/paddle/operators/math/selected_rows_functor.cu @@ -126,7 +126,8 @@ struct SelectedRowsAddTensor { dim3 grid(1, in1_rows.size()); SelectedRowsAddTensorKernel< T, block_size><<>>( - in1_data, in1_rows.cuda_data(), out_data, in1_row_numel); + in1_data, in1_rows.CUDAData(context.GetPlace()), out_data, + in1_row_numel); auto out_eigen = framework::EigenVector::Flatten(*output); auto in2_eigen = framework::EigenVector::Flatten(input2); @@ -153,7 +154,7 @@ struct SelectedRowsAddTo { auto* in2_value = input2->mutable_value(); // concat rows - in2_rows.insert(in2_rows.end(), in1_rows.begin(), in1_rows.end()); + in2_rows.Extend(in1_rows.begin(), in1_rows.end()); auto in1_place = input1.place(); PADDLE_ENFORCE(platform::is_gpu_place(in1_place)); @@ -216,7 +217,8 @@ struct SelectedRowsAddToTensor { dim3 grid(1, in1_rows.size()); SelectedRowsAddToTensorKernel< T, block_size><<>>( - in1_data, in1_rows.cuda_data(), in2_data, in1_row_numel); + in1_data, in1_rows.CUDAData(context.GetPlace()), in2_data, + in1_row_numel); } }; @@ -283,9 +285,10 @@ struct MergeAdd { MergeAddKernel< T, 256><<(context) - .stream()>>>(input_data, input_rows.cuda_data(), out_data, - out.mutable_rows()->cuda_data(), - out.rows().size(), input_width); + .stream()>>>( + input_data, input_rows.CUDAData(context.GetPlace()), out_data, + out.mutable_rows()->CUDAMutableData(context.GetPlace()), + out.rows().size(), input_width); return out; } }; diff --git a/paddle/operators/math/sequence2batch.cu b/paddle/operators/math/sequence2batch.cu index f27631271a4..eaed2c30a80 100644 --- a/paddle/operators/math/sequence2batch.cu +++ b/paddle/operators/math/sequence2batch.cu @@ -45,7 +45,6 @@ class CopyMatrixRowsFunctor { const framework::Tensor& src, framework::Vector index_lod, framework::Tensor& dst, bool is_src_index) { - size_t* index = index_lod.cuda_data(); auto src_dims = src.dims(); auto dst_dims = dst.dims(); PADDLE_ENFORCE_EQ(src_dims.size(), 2, @@ -63,7 +62,8 @@ class CopyMatrixRowsFunctor { dim3 grid(8, 1); auto stream = context.stream(); CopyMatrixRowsKernel<<>>( - src_data, dst_data, index, height, width, is_src_index); + src_data, dst_data, index_lod.CUDAData(context.GetPlace()), height, + width, is_src_index); } }; diff --git a/paddle/operators/math/sequence_padding.cu b/paddle/operators/math/sequence_padding.cu index 65c9cfe4a0e..c2bd56448aa 100644 --- a/paddle/operators/math/sequence_padding.cu +++ b/paddle/operators/math/sequence_padding.cu @@ -121,12 +121,12 @@ class PaddingLoDTensorFunctor { if (norm_by_times) { SequencePaddingKernel<<>>( padding_data, const_cast(seq_data), - abs_offset_lod[level].cuda_data(), sequence_width, + abs_offset_lod[level].CUDAData(context.GetPlace()), sequence_width, max_sequence_length, num_sequences); } else { SequencePaddingKernel<<>>( padding_data, const_cast(seq_data), - abs_offset_lod[level].cuda_data(), sequence_width, + abs_offset_lod[level].CUDAData(context.GetPlace()), sequence_width, max_sequence_length, num_sequences); } } @@ -196,12 +196,12 @@ class UnpaddingLoDTensorFunctor { if (norm_by_times) { SequencePaddingKernel<<>>( const_cast(padding_data), seq_data, - abs_offset_lod[level].cuda_data(), sequence_width, + abs_offset_lod[level].CUDAData(context.GetPlace()), sequence_width, max_sequence_length, num_sequences); } else { SequencePaddingKernel<<>>( const_cast(padding_data), seq_data, - abs_offset_lod[level].cuda_data(), sequence_width, + abs_offset_lod[level].CUDAData(context.GetPlace()), sequence_width, max_sequence_length, num_sequences); } } diff --git a/paddle/operators/math/sequence_pooling.cu b/paddle/operators/math/sequence_pooling.cu index f66534a6812..c69bd3da7e7 100644 --- a/paddle/operators/math/sequence_pooling.cu +++ b/paddle/operators/math/sequence_pooling.cu @@ -73,7 +73,8 @@ class MaxSeqPoolFunctor { dim3 grid(num_seq, 1); auto stream = context.stream(); KeMaxSequencePool<<>>( - in_data, starts.cuda_data(), out_data, max_index, num_seq, dim); + in_data, starts.CUDAData(context.GetPlace()), out_data, max_index, + num_seq, dim); } }; diff --git a/paddle/operators/math/sequence_scale.cu b/paddle/operators/math/sequence_scale.cu index fd4e28f6113..7cb9242db93 100644 --- a/paddle/operators/math/sequence_scale.cu +++ b/paddle/operators/math/sequence_scale.cu @@ -46,7 +46,8 @@ class ScaleLoDTensorFunctor { SequenceScaleKernel<<< num_seq, PADDLE_CUDA_NUM_THREADS, 0, context.stream()>>>( - seq_data, abs_offset_lod[level].cuda_data(), scales, seq_width); + seq_data, abs_offset_lod[level].CUDAMutableData(context.GetPlace()), + scales, seq_width); } }; diff --git a/paddle/operators/parallel_do_op.cc b/paddle/operators/parallel_do_op.cc index 89045923f9f..edb9de82509 100644 --- a/paddle/operators/parallel_do_op.cc +++ b/paddle/operators/parallel_do_op.cc @@ -79,9 +79,6 @@ inline void CopyOrShare(const framework::Variable &src, dst->GetMutable()->set_lod(src.Get().lod()); } else { Copy(src.Get(), dst_place, dst->GetMutable()); - framework::LoD lod(src.Get().lod()); - lod.CopyToPeer(dst_place); - dst->GetMutable()->set_lod(lod); } } else if (src.IsType()) { auto &src_sr = src.Get(); @@ -92,9 +89,6 @@ inline void CopyOrShare(const framework::Variable &src, dst_sr->set_rows(src_sr.rows()); } else { Copy(src_sr.value(), dst_place, dst_sr->mutable_value()); - framework::Vector lod(src_sr.rows()); - lod.CopyToPeer(dst_place); - dst_sr->set_rows(lod); } } else { PADDLE_THROW("Expect LoDTensor/SelectedRows, get %s", src.Type().name()); @@ -152,9 +146,6 @@ class ParallelDoOp : public framework::OperatorBase { auto *sub_scope = sub_scopes[i]; auto *dst = sub_scope->Var(param)->GetMutable(); framework::Copy(src, place, dst); - framework::LoD lod(src.lod()); - lod.CopyToPeer(place); - dst->set_lod(lod); } } WaitOnPlaces(places); diff --git a/paddle/operators/row_conv_op.cu b/paddle/operators/row_conv_op.cu index b3825212e1a..d1a6d119d3d 100644 --- a/paddle/operators/row_conv_op.cu +++ b/paddle/operators/row_conv_op.cu @@ -307,7 +307,7 @@ class RowConvKernel int input_dim = X->dims()[1]; int num_sequence = batch_indices.size() - 1; int future_context = Filter->dims()[0]; - size_t *idx = batch_indices.cuda_data(); + size_t *idx = batch_indices.CUDAMutableData(context.GetPlace()); auto stream = context.cuda_device_context().stream(); if (future_context <= 32) { @@ -345,7 +345,7 @@ class RowConvGradKernel int input_dim = X->dims()[1]; int num_sequence = batch_indices.size() - 1; int future_context = Filter->dims()[0]; - size_t *idx = batch_indices.cuda_data(); + size_t *idx = batch_indices.CUDAMutableData(context.GetPlace()); auto &device_ctx = context.cuda_device_context(); math::SetConstant zero; diff --git a/paddle/operators/sequence_erase_op.cu b/paddle/operators/sequence_erase_op.cu index a5311f15f0c..4a7217cfd65 100644 --- a/paddle/operators/sequence_erase_op.cu +++ b/paddle/operators/sequence_erase_op.cu @@ -87,8 +87,7 @@ class SequenceEraseOpCUDAKernel : public framework::OpKernel { // Copy LoD to GPU auto lod0 = lod[0]; auto lod_len = lod0.size(); - thrust::device_vector dev_in_lod = lod0; - size_t* dev_in_lod_ptr = thrust::raw_pointer_cast(dev_in_lod.data()); + const size_t* dev_in_lod_ptr = lod0.CUDAData(ctx.GetPlace()); // Calc output LoD thrust::device_vector dev_out_lod(lod_len); diff --git a/paddle/operators/sgd_op.cu b/paddle/operators/sgd_op.cu index 29f5aa3542c..d27befe4460 100644 --- a/paddle/operators/sgd_op.cu +++ b/paddle/operators/sgd_op.cu @@ -102,8 +102,8 @@ class SGDOpCUDAKernel : public framework::OpKernel { dim3 grid(1, in_rows.size()); SparseSGDFunctorKernel< T, 256><<>>( - in_data, in_rows.cuda_data(), learning_rate->data(), out_data, - in_row_numel); + in_data, in_rows.CUDAData(ctx.GetPlace()), learning_rate->data(), + out_data, in_row_numel); } else { PADDLE_THROW("Unsupported Variable Type of Grad"); diff --git a/paddle/operators/target_assign_op.h b/paddle/operators/target_assign_op.h index 82fca5724c0..574919e1ef8 100644 --- a/paddle/operators/target_assign_op.h +++ b/paddle/operators/target_assign_op.h @@ -137,8 +137,8 @@ class TargetAssignKernel : public framework::OpKernel { PADDLE_ENFORCE_EQ(gt_lod.data()[i], gt_label_lod.data()[i]); } - size_t* gt_lod_data = gt_lod.data(ctx.GetPlace()); - size_t* neg_lod_data = neg_lod.data(ctx.GetPlace()); + size_t* gt_lod_data = gt_lod.MutableData(ctx.GetPlace()); + size_t* neg_lod_data = neg_lod.MutableData(ctx.GetPlace()); TargetAssignFunctor functor(box_data, label_data, match_idx_data, gt_lod_data, background_label, num, diff --git a/paddle/testing/paddle_gtest_main.cc b/paddle/testing/paddle_gtest_main.cc index fd8c4a69da8..ab84f1c292b 100644 --- a/paddle/testing/paddle_gtest_main.cc +++ b/paddle/testing/paddle_gtest_main.cc @@ -20,6 +20,7 @@ limitations under the License. */ #include "paddle/memory/memory.h" int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); std::vector new_argv; std::string gflags_env; for (int i = 0; i < argc; ++i) { @@ -35,7 +36,6 @@ int main(int argc, char** argv) { int new_argc = static_cast(new_argv.size()); char** new_argv_address = new_argv.data(); google::ParseCommandLineFlags(&new_argc, &new_argv_address, false); - testing::InitGoogleTest(&argc, argv); paddle::memory::Used(paddle::platform::CPUPlace()); #ifdef PADDLE_WITH_CUDA -- GitLab From 36da52950d53fdcd6903913a627b5e622648f5f4 Mon Sep 17 00:00:00 2001 From: Siddharth Goyal Date: Thu, 8 Feb 2018 13:46:33 -0800 Subject: [PATCH 22/55] Better version of PR #7985 (Modify load() for inference) (#8024) * Refine load * Address review comments: round 1 * Make API consistent with python-save/load * Add another unit test * Remove commented function * Fix GPU bug * Address review comments * Modify wrt PR 8147 * Fix filenames for combined case * Fix typo * Address review comments: round 2 * Unify TestInference by keeping default param in template * Address review comment * Fix spacing --- paddle/inference/io.cc | 73 +++++++++++++++---- paddle/inference/io.h | 8 +- paddle/inference/tests/book/test_helper.h | 17 ++++- .../book/test_inference_recognize_digits.cc | 42 +++++++++++ python/paddle/v2/fluid/io.py | 12 ++- .../fluid/tests/book/test_recognize_digits.py | 44 +++++++---- 6 files changed, 159 insertions(+), 37 deletions(-) diff --git a/paddle/inference/io.cc b/paddle/inference/io.cc index 1ed14b69c83..784e87970f7 100644 --- a/paddle/inference/io.cc +++ b/paddle/inference/io.cc @@ -21,6 +21,17 @@ limitations under the License. */ namespace paddle { namespace inference { +void ReadBinaryFile(const std::string& filename, std::string& contents) { + VLOG(3) << "loading model from " << filename; + std::ifstream inputfs(filename, std::ios::in | std::ios::binary); + inputfs.seekg(0, std::ios::end); + contents.clear(); + contents.resize(inputfs.tellg()); + inputfs.seekg(0, std::ios::beg); + inputfs.read(&contents[0], contents.size()); + inputfs.close(); +} + bool IsParameter(const framework::VarDesc* var, const framework::ProgramDesc& main_program) { if (var->Persistable()) { @@ -44,12 +55,15 @@ bool IsParameter(const framework::VarDesc* var, void LoadPersistables(framework::Executor& executor, framework::Scope& scope, + const framework::ProgramDesc& main_program, const std::string& dirname, - const framework::ProgramDesc& main_program) { + const std::string& param_filename) { const framework::BlockDesc& global_block = main_program.Block(0); framework::ProgramDesc* load_program = new framework::ProgramDesc(); framework::BlockDesc* load_block = load_program->MutableBlock(0); + std::vector paramlist; + for (auto* var : global_block.AllVars()) { if (IsParameter(var, main_program)) { VLOG(3) << "parameter's name: " << var->Name(); @@ -61,15 +75,33 @@ void LoadPersistables(framework::Executor& executor, new_var->SetLoDLevel(var->GetLoDLevel()); new_var->SetPersistable(true); - // append_op - framework::OpDesc* op = load_block->AppendOp(); - op->SetType("load"); - op->SetOutput("Out", {new_var->Name()}); - op->SetAttr("file_path", {dirname + "/" + new_var->Name()}); - op->CheckAttrs(); + if (!param_filename.empty()) { + paramlist.push_back(new_var->Name()); + } else { + // append_op + framework::OpDesc* op = load_block->AppendOp(); + op->SetType("load"); + op->SetOutput("Out", {new_var->Name()}); + op->SetAttr("file_path", {dirname + "/" + new_var->Name()}); + op->CheckAttrs(); + } } } + + if (!param_filename.empty()) { + // sort paramlist to have consistent ordering + std::sort(paramlist.begin(), paramlist.end()); + // append just the load_combine op + framework::OpDesc* op = load_block->AppendOp(); + op->SetType("load_combine"); + op->SetOutput("Out", paramlist); + op->SetAttr("file_path", {param_filename}); + op->CheckAttrs(); + } + executor.Run(*load_program, &scope, 0, true, true); + + VLOG(3) << "Ran loading successfully"; delete load_program; } @@ -77,20 +109,29 @@ std::unique_ptr Load(framework::Executor& executor, framework::Scope& scope, const std::string& dirname) { std::string model_filename = dirname + "/__model__"; - LOG(INFO) << "loading model from " << model_filename; - std::ifstream inputfs(model_filename, std::ios::in | std::ios::binary); std::string program_desc_str; - inputfs.seekg(0, std::ios::end); - program_desc_str.resize(inputfs.tellg()); - inputfs.seekg(0, std::ios::beg); - LOG(INFO) << "program_desc_str's size: " << program_desc_str.size(); - inputfs.read(&program_desc_str[0], program_desc_str.size()); - inputfs.close(); + ReadBinaryFile(model_filename, program_desc_str); + + std::unique_ptr main_program( + new framework::ProgramDesc(program_desc_str)); + + LoadPersistables(executor, scope, *main_program, dirname, ""); + return main_program; +} + +std::unique_ptr Load( + framework::Executor& executor, + framework::Scope& scope, + const std::string& prog_filename, + const std::string& param_filename) { + std::string model_filename = prog_filename; + std::string program_desc_str; + ReadBinaryFile(model_filename, program_desc_str); std::unique_ptr main_program( new framework::ProgramDesc(program_desc_str)); - LoadPersistables(executor, scope, dirname, *main_program); + LoadPersistables(executor, scope, *main_program, "", param_filename); return main_program; } diff --git a/paddle/inference/io.h b/paddle/inference/io.h index 962b6c4e20d..a7d7c499690 100644 --- a/paddle/inference/io.h +++ b/paddle/inference/io.h @@ -26,12 +26,18 @@ namespace inference { void LoadPersistables(framework::Executor& executor, framework::Scope& scope, + const framework::ProgramDesc& main_program, const std::string& dirname, - const framework::ProgramDesc& main_program); + const std::string& param_filename); std::unique_ptr Load(framework::Executor& executor, framework::Scope& scope, const std::string& dirname); +std::unique_ptr Load(framework::Executor& executor, + framework::Scope& scope, + const std::string& prog_filename, + const std::string& param_filename); + } // namespace inference } // namespace paddle diff --git a/paddle/inference/tests/book/test_helper.h b/paddle/inference/tests/book/test_helper.h index 32db643fca2..3e66ced94fe 100644 --- a/paddle/inference/tests/book/test_helper.h +++ b/paddle/inference/tests/book/test_helper.h @@ -67,17 +67,28 @@ void CheckError(paddle::framework::LoDTensor& output1, EXPECT_EQ(count, 0) << "There are " << count << " different elements."; } -template +template void TestInference(const std::string& dirname, const std::vector& cpu_feeds, std::vector& cpu_fetchs) { - // 1. Define place, executor and scope + // 1. Define place, executor, scope and inference_program auto place = Place(); auto executor = paddle::framework::Executor(place); auto* scope = new paddle::framework::Scope(); + std::unique_ptr inference_program; // 2. Initialize the inference_program and load all parameters from file - auto inference_program = paddle::inference::Load(executor, *scope, dirname); + if (IsCombined) { + // Hard-coding the names for combined params case + std::string prog_filename = "__model_combined__"; + std::string param_filename = "__params_combined__"; + inference_program = paddle::inference::Load(executor, + *scope, + dirname + "/" + prog_filename, + dirname + "/" + param_filename); + } else { + inference_program = paddle::inference::Load(executor, *scope, dirname); + } // 3. Get the feed_target_names and fetch_target_names const std::vector& feed_target_names = diff --git a/paddle/inference/tests/book/test_inference_recognize_digits.cc b/paddle/inference/tests/book/test_inference_recognize_digits.cc index 48f887e6bc6..3a48db7fe08 100644 --- a/paddle/inference/tests/book/test_inference_recognize_digits.cc +++ b/paddle/inference/tests/book/test_inference_recognize_digits.cc @@ -59,3 +59,45 @@ TEST(inference, recognize_digits) { CheckError(output1, output2); #endif } + +TEST(inference, recognize_digits_combine) { + if (FLAGS_dirname.empty()) { + LOG(FATAL) << "Usage: ./example --dirname=path/to/your/model"; + } + + LOG(INFO) << "FLAGS_dirname: " << FLAGS_dirname << std::endl; + std::string dirname = FLAGS_dirname; + + // 0. Call `paddle::framework::InitDevices()` initialize all the devices + // In unittests, this is done in paddle/testing/paddle_gtest_main.cc + + paddle::framework::LoDTensor input; + // Use normilized image pixels as input data, + // which should be in the range [-1.0, 1.0]. + SetupTensor( + input, {1, 28, 28}, static_cast(-1), static_cast(1)); + std::vector cpu_feeds; + cpu_feeds.push_back(&input); + + paddle::framework::LoDTensor output1; + std::vector cpu_fetchs1; + cpu_fetchs1.push_back(&output1); + + // Run inference on CPU + TestInference( + dirname, cpu_feeds, cpu_fetchs1); + LOG(INFO) << output1.dims(); + +#ifdef PADDLE_WITH_CUDA + paddle::framework::LoDTensor output2; + std::vector cpu_fetchs2; + cpu_fetchs2.push_back(&output2); + + // Run inference on CUDA GPU + TestInference( + dirname, cpu_feeds, cpu_fetchs2); + LOG(INFO) << output2.dims(); + + CheckError(output1, output2); +#endif +} diff --git a/python/paddle/v2/fluid/io.py b/python/paddle/v2/fluid/io.py index 613dc20b6ea..0f43e46082a 100644 --- a/python/paddle/v2/fluid/io.py +++ b/python/paddle/v2/fluid/io.py @@ -342,7 +342,11 @@ def save_inference_model(dirname, prepend_feed_ops(inference_program, feeded_var_names) append_fetch_ops(inference_program, fetch_var_names) - model_file_name = dirname + "/__model__" + if save_file_name == None: + model_file_name = dirname + "/__model__" + else: + model_file_name = dirname + "/__model_combined__" + with open(model_file_name, "wb") as f: f.write(inference_program.desc.serialize_to_string()) @@ -384,7 +388,11 @@ def load_inference_model(dirname, executor, load_file_name=None): if not os.path.isdir(dirname): raise ValueError("There is no directory named '%s'", dirname) - model_file_name = dirname + "/__model__" + if load_file_name == None: + model_file_name = dirname + "/__model__" + else: + model_file_name = dirname + "/__model_combined__" + with open(model_file_name, "rb") as f: program_desc_str = f.read() diff --git a/python/paddle/v2/fluid/tests/book/test_recognize_digits.py b/python/paddle/v2/fluid/tests/book/test_recognize_digits.py index d8f0ad89cd8..6f9d85faff9 100644 --- a/python/paddle/v2/fluid/tests/book/test_recognize_digits.py +++ b/python/paddle/v2/fluid/tests/book/test_recognize_digits.py @@ -78,7 +78,7 @@ def conv_net(img, label): return loss_net(conv_pool_2, label) -def train(nn_type, use_cuda, parallel, save_dirname): +def train(nn_type, use_cuda, parallel, save_dirname, save_param_filename): if use_cuda and not fluid.core.is_compiled_with_cuda(): return img = fluid.layers.data(name='img', shape=[1, 28, 28], dtype='float32') @@ -143,8 +143,10 @@ def train(nn_type, use_cuda, parallel, save_dirname): avg_loss_val = numpy.array(avg_loss_set).mean() if float(acc_val) > 0.85: # test acc > 85% if save_dirname is not None: - fluid.io.save_inference_model(save_dirname, ["img"], - [prediction], exe) + fluid.io.save_inference_model( + save_dirname, ["img"], [prediction], + exe, + save_file_name=save_param_filename) return else: print( @@ -156,7 +158,7 @@ def train(nn_type, use_cuda, parallel, save_dirname): raise AssertionError("Loss of recognize digits is too large") -def infer(use_cuda, save_dirname=None): +def infer(use_cuda, save_dirname=None, param_filename=None): if save_dirname is None: return @@ -167,8 +169,8 @@ def infer(use_cuda, save_dirname=None): # the feed_target_names (the names of variables that will be feeded # data using feed operators), and the fetch_targets (variables that # we want to obtain data from using fetch operators). - [inference_program, feed_target_names, - fetch_targets] = fluid.io.load_inference_model(save_dirname, exe) + [inference_program, feed_target_names, fetch_targets + ] = fluid.io.load_inference_model(save_dirname, exe, param_filename) # The input's dimension of conv should be 4-D or 5-D. # Use normilized image pixels as input data, which should be in the range [-1.0, 1.0]. @@ -183,36 +185,45 @@ def infer(use_cuda, save_dirname=None): print("infer results: ", results[0]) -def main(use_cuda, parallel, nn_type): +def main(use_cuda, parallel, nn_type, combine): if not use_cuda and not parallel: save_dirname = "recognize_digits_" + nn_type + ".inference.model" + save_filename = None + if combine == True: + save_filename = "__params_combined__" else: save_dirname = None + save_filename = None train( nn_type=nn_type, use_cuda=use_cuda, parallel=parallel, - save_dirname=save_dirname) - infer(use_cuda=use_cuda, save_dirname=save_dirname) + save_dirname=save_dirname, + save_param_filename=save_filename) + infer( + use_cuda=use_cuda, + save_dirname=save_dirname, + param_filename=save_filename) class TestRecognizeDigits(unittest.TestCase): pass -def inject_test_method(use_cuda, parallel, nn_type): +def inject_test_method(use_cuda, parallel, nn_type, combine): def __impl__(self): prog = fluid.Program() startup_prog = fluid.Program() scope = fluid.core.Scope() with fluid.scope_guard(scope): with fluid.program_guard(prog, startup_prog): - main(use_cuda, parallel, nn_type) + main(use_cuda, parallel, nn_type, combine) - fn = 'test_{0}_{1}_{2}'.format(nn_type, 'cuda' - if use_cuda else 'cpu', 'parallel' - if parallel else 'normal') + fn = 'test_{0}_{1}_{2}_{3}'.format(nn_type, 'cuda' + if use_cuda else 'cpu', 'parallel' + if parallel else 'normal', 'combine' + if combine else 'separate') setattr(TestRecognizeDigits, fn, __impl__) @@ -221,7 +232,10 @@ def inject_all_tests(): for use_cuda in (False, True): for parallel in (False, True): for nn_type in ('mlp', 'conv'): - inject_test_method(use_cuda, parallel, nn_type) + inject_test_method(use_cuda, parallel, nn_type, True) + + # One unit-test for saving parameters as separate files + inject_test_method(False, False, 'mlp', False) inject_all_tests() -- GitLab From 6c7ba81c0ae79275067bf1bab61358681087ec30 Mon Sep 17 00:00:00 2001 From: guosheng Date: Wed, 7 Feb 2018 23:58:02 +0800 Subject: [PATCH 23/55] Add python wrapper for layer_norm --- doc/api/v2/fluid/layers.rst | 6 ++ python/paddle/v2/fluid/__init__.py | 8 +-- python/paddle/v2/fluid/layers/nn.py | 105 ++++++++++++++++++++++++++-- python/paddle/v2/fluid/nets.py | 5 +- 4 files changed, 114 insertions(+), 10 deletions(-) diff --git a/doc/api/v2/fluid/layers.rst b/doc/api/v2/fluid/layers.rst index e24613b94b4..58c493fd741 100644 --- a/doc/api/v2/fluid/layers.rst +++ b/doc/api/v2/fluid/layers.rst @@ -323,6 +323,12 @@ batch_norm .. autofunction:: paddle.v2.fluid.layers.batch_norm :noindex: +layer_norm +---------- + +.. autofunction:: paddle.v2.fluid.layers.layer_norm + :noindex: + beam_search_decode ------------------ diff --git a/python/paddle/v2/fluid/__init__.py b/python/paddle/v2/fluid/__init__.py index 3ee58393c72..03178ecdcbc 100644 --- a/python/paddle/v2/fluid/__init__.py +++ b/python/paddle/v2/fluid/__init__.py @@ -29,7 +29,7 @@ import optimizer import learning_rate_decay import backward import regularizer -from param_attr import ParamAttr +from param_attr import ParamAttr, WeightNormParamAttr from data_feeder import DataFeeder from core import LoDTensor, CPUPlace, CUDAPlace from distribute_transpiler import DistributeTranspiler @@ -43,9 +43,9 @@ Tensor = LoDTensor __all__ = framework.__all__ + executor.__all__ + [ 'io', 'initializer', 'layers', 'nets', 'optimizer', 'learning_rate_decay', 'backward', 'regularizer', 'LoDTensor', 'CPUPlace', 'CUDAPlace', 'Tensor', - 'ParamAttr' - 'DataFeeder', 'clip', 'SimpleDistributeTranspiler', 'DistributeTranspiler', - 'memory_optimize', 'profiler' + 'ParamAttr', 'WeightNormParamAttr', 'DataFeeder', 'clip', + 'SimpleDistributeTranspiler', 'DistributeTranspiler', 'memory_optimize', + 'profiler' ] diff --git a/python/paddle/v2/fluid/layers/nn.py b/python/paddle/v2/fluid/layers/nn.py index a79479f469a..fa7062a3fb4 100644 --- a/python/paddle/v2/fluid/layers/nn.py +++ b/python/paddle/v2/fluid/layers/nn.py @@ -65,6 +65,7 @@ __all__ = [ 'beam_search', 'row_conv', 'multiplex', + 'layer_norm', ] @@ -641,8 +642,8 @@ def dynamic_gru(input, Choices = ["sigmoid", "tanh", "relu", "identity"], default "tanh". Returns: - Variable: The hidden state of GRU. The shape is (T \\times D), and lod \ - is the same with the input. + Variable: The hidden state of GRU. The shape is :math:`(T \\times D)`, \ + and lod is the same with the input. Examples: .. code-block:: python @@ -990,7 +991,7 @@ def square_error_cost(input, label, **kwargs): label(Variable): Label tensor, has target labels. Returns: - Variable: The tensor variable storing the element-wise squared error + Variable: The tensor variable storing the element-wise squared error \ difference of input and label. Examples: @@ -1214,7 +1215,7 @@ def conv2d(input, act(str): Activation type. Default: None Returns: - Variable: The tensor variable storing the convolution and + Variable: The tensor variable storing the convolution and \ non-linearity activation result. Raises: @@ -1565,6 +1566,102 @@ def batch_norm(input, return helper.append_activation(batch_norm_out) +def layer_norm(input, + scale=True, + shift=True, + begin_norm_axis=1, + epsilon=1e-05, + param_attr=None, + bias_attr=None, + act=None, + name=None): + """ + **Layer Normalization** + + Assume feature vectors exist on dimensions + :attr:`begin_norm_axis ... rank(input)` and calculate the moment statistics + along these dimensions for each feature vector :math:`a` with size + :math:`H`, then normalize each feature vector using the corresponding + statistics. After that, apply learnable gain and bias on the normalized + tensor to scale and shift if :attr:`scale` and :attr:`shift` are set. + + Refer to `Layer Normalization `_ + + The formula is as follows: + + .. math:: + + \\mu & = \\frac{1}{H}\\sum_{i=1}^{H} a_i + + \\sigma & = \\sqrt{\\frac{1}{H}\sum_{i=1}^{H}(a_i - \\mu)^2} + + h & = f(\\frac{g}{\\sigma}(a - \\mu) + b) + + Args: + input(Variable): The input tensor variable. + scale(bool): Whether to learn the adaptive gain :math:`g` after + normalization. + shift(bool): Whether to learn the adaptive bias :math:`b` after + normalization. + begin_norm_axis(bool): The normalization will be performed along + dimensions from :attr:`begin_norm_axis` to :attr:`rank(input)`. + epsilon(float): The small value added to the variance to prevent + division by zero. + param_attr(ParamAttr|None): The parameter attribute for the learnable + gain :math:`g`. + bias_attr(ParamAttr|None): The parameter attribute for the learnable + bias :math:`b`. + act(str): Activation to be applied to the output of layer normalizaiton. + + Returns: + Variable: A tensor variable with the same shape as the input. + + Examples: + .. code-block:: python + + data = fluid.layers.data( + name='data', shape=[3, 32, 32], dtype='float32') + x = fluid.layers.layer_norm(input=data, begin_norm_axis=1) + """ + helper = LayerHelper('layer_norm', **locals()) + dtype = helper.input_dtype() + + # create intput and parameters + inputs = {'X': input} + input_shape = input.shape + param_shape = [reduce(lambda x, y: x * y, input_shape[begin_norm_axis:])] + if scale: + scale = helper.create_parameter( + attr=helper.param_attr, + shape=param_shape, + dtype=dtype, + default_initializer=Constant(1.0)) + inputs['Scale'] = scale + if center: + assert bias_attr is not False + bias = helper.create_parameter( + attr=helper.bias_attr, shape=param_shape, dtype=dtype, is_bias=True) + inputs['Bias'] = bias + + # create output + mean_out = helper.create_tmp_variable(dtype=dtype, stop_gradient=True) + variance_out = helper.create_tmp_variable(dtype=dtype, stop_gradient=True) + layer_norm_out = helper.create_tmp_variable(dtype) + + helper.append_op( + type="layer_norm", + inputs=inputs, + outputs={ + "Y": layer_norm_out, + "Mean": mean_out, + "Variance": variance_out, + }, + attrs={"epsilon": epsilon, + "begin_norm_axis": begin_norm_axis}) + + return helper.append_activation(layer_norm_out) + + def beam_search_decode(ids, scores, name=None): helper = LayerHelper('beam_search_decode', **locals()) sentence_ids = helper.create_tmp_variable(dtype=ids.dtype) diff --git a/python/paddle/v2/fluid/nets.py b/python/paddle/v2/fluid/nets.py index cb63d43709e..be7878f869b 100644 --- a/python/paddle/v2/fluid/nets.py +++ b/python/paddle/v2/fluid/nets.py @@ -194,7 +194,7 @@ def scaled_dot_product_attention(queries, Returns: - Variable: A 3-D Tensor computed by multi-head scaled dot product + Variable: A 3-D Tensor computed by multi-head scaled dot product \ attention. Raises: @@ -333,6 +333,7 @@ def scaled_dot_product_attention(queries, x=product, shape=[-1, product.shape[-1]], act="softmax"), shape=product.shape) if dropout_rate: - weights = layers.dropout(x, dropout_prob=dropout_rate, is_test=False) + weights = layers.dropout( + weights, dropout_prob=dropout_rate, is_test=False) ctx_multiheads = layers.matmul(weights, v) return __combine_heads(ctx_multiheads) -- GitLab From 0a7ae369f6d6a6be7b87d13834b8ff0a7e3614d1 Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Fri, 9 Feb 2018 10:27:47 +0800 Subject: [PATCH 24/55] fix CI hung --- .../tests/book_memory_optimization/test_memopt_fit_a_line.py | 4 ++++ .../test_memopt_image_classification_train.py | 5 +++++ .../test_memopt_machine_translation.py | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_fit_a_line.py b/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_fit_a_line.py index 7ad5e2c594f..045db8390cd 100644 --- a/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_fit_a_line.py +++ b/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_fit_a_line.py @@ -15,6 +15,8 @@ import numpy as np import paddle.v2 as paddle import paddle.v2.fluid as fluid +import math +import sys # need to fix random seed and training data to compare the loss # value accurately calculated by the default and the memory optimization @@ -63,4 +65,6 @@ for pass_id in range(PASS_NUM): if avg_loss_value[0] < 10.0: exit(0) # if avg cost less than 10.0, we think our code is good. + if math.isnan(float(avg_loss_value)): + sys.exit("got NaN loss, training failed.") exit(1) diff --git a/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py b/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py index 26673afd83c..9fbb36d3638 100644 --- a/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py +++ b/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py @@ -18,6 +18,8 @@ import sys import paddle.v2 as paddle import paddle.v2.fluid as fluid +import math +import sys # need to fix random seed and training data to compare the loss # value accurately calculated by the default and the memory optimization @@ -152,7 +154,10 @@ for pass_id in range(PASS_NUM): print("loss:" + str(loss) + " acc:" + str(acc) + " pass_acc:" + str( pass_acc)) # this model is slow, so if we can train two mini batch, we think it works properly. + if i > 2: exit(0) + if math.isnan(float(loss)): + sys.exit("got NaN loss, training failed.") i += 1 exit(1) diff --git a/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_machine_translation.py b/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_machine_translation.py index ffd53e7a781..48abaa8d875 100644 --- a/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_machine_translation.py +++ b/python/paddle/v2/fluid/tests/book_memory_optimization/test_memopt_machine_translation.py @@ -19,6 +19,8 @@ import paddle.v2.fluid.core as core import paddle.v2.fluid.framework as framework import paddle.v2.fluid.layers as layers from paddle.v2.fluid.executor import Executor +import math +import sys dict_size = 30000 source_dict_dim = target_dict_dim = dict_size @@ -137,6 +139,8 @@ def main(): " avg_cost=" + str(avg_cost_val)) if batch_id > 2: exit(0) + if math.isnan(float(avg_cost_val)): + sys.exit("got NaN loss, training failed.") batch_id += 1 -- GitLab From 67e4ff84d144ba10c1e2484f6bf30652bc9e8322 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Fri, 9 Feb 2018 10:33:32 +0800 Subject: [PATCH 25/55] Remove checking 'numel' of 'X' and 'Y' --- paddle/operators/compare_op.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/operators/compare_op.cc b/paddle/operators/compare_op.cc index 930c295a9cb..51b5bcb38f9 100644 --- a/paddle/operators/compare_op.cc +++ b/paddle/operators/compare_op.cc @@ -58,8 +58,8 @@ class CompareOpInferShape : public framework::InferShapeBase { comment.type); auto dim_x = context->GetInputDim("X"); auto dim_y = context->GetInputDim("Y"); - PADDLE_ENFORCE_EQ(framework::product(dim_x), framework::product(dim_y), - "The number of elements in X and Y should be same"); + PADDLE_ENFORCE_GE(dim_x.size(), dim_y.size(), + "The size of dim_y should not be greater than dim_x's."); context->SetOutputDim("Out", context->GetInputDim("X")); context->ShareLoD("X", "Out"); -- GitLab From 0999347910609334e06caddc5a010ce1af568d5e Mon Sep 17 00:00:00 2001 From: guosheng Date: Fri, 9 Feb 2018 11:04:28 +0800 Subject: [PATCH 26/55] Fix python wrapper for layer_norm --- paddle/operators/layer_norm_op.cc | 2 -- python/paddle/v2/fluid/layers/nn.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/paddle/operators/layer_norm_op.cc b/paddle/operators/layer_norm_op.cc index 76d5d571c31..d9b774272cb 100644 --- a/paddle/operators/layer_norm_op.cc +++ b/paddle/operators/layer_norm_op.cc @@ -116,8 +116,6 @@ class LayerNormGradOp : public framework::OperatorWithKernel { // check input PADDLE_ENFORCE(ctx->HasInput("X"), "Input(X) of LayerNormOp should not be null."); - PADDLE_ENFORCE(ctx->HasInput("Scale"), - "Input(Scale) of LayerNormOp should not be null."); PADDLE_ENFORCE(ctx->HasInput("Mean"), "Input(Mean) of LayerNormOp should not be null."); PADDLE_ENFORCE(ctx->HasInput("Variance"), diff --git a/python/paddle/v2/fluid/layers/nn.py b/python/paddle/v2/fluid/layers/nn.py index e8455a8b41e..0b64e09cd35 100644 --- a/python/paddle/v2/fluid/layers/nn.py +++ b/python/paddle/v2/fluid/layers/nn.py @@ -1637,7 +1637,7 @@ def layer_norm(input, dtype=dtype, default_initializer=Constant(1.0)) inputs['Scale'] = scale - if center: + if shift: assert bias_attr is not False bias = helper.create_parameter( attr=helper.bias_attr, shape=param_shape, dtype=dtype, is_bias=True) -- GitLab From b5ffe5bce205ea9ce48a329edd6f19164c8608f2 Mon Sep 17 00:00:00 2001 From: QI JUN Date: Fri, 9 Feb 2018 11:08:02 +0800 Subject: [PATCH 27/55] optimize data flow analysis (#8271) --- python/paddle/v2/fluid/memory_optimization_transpiler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/paddle/v2/fluid/memory_optimization_transpiler.py b/python/paddle/v2/fluid/memory_optimization_transpiler.py index 8bb8cf7b1a5..53e0991ee8c 100644 --- a/python/paddle/v2/fluid/memory_optimization_transpiler.py +++ b/python/paddle/v2/fluid/memory_optimization_transpiler.py @@ -92,14 +92,13 @@ class ControlFlowGraph(object): live_in = defaultdict(set) live_out = defaultdict(set) while True: - for i in range(self.op_size): + for i in range(self.op_size, 0, -1): live_in[i] = set(self._live_in[i]) live_out[i] = set(self._live_out[i]) - self._live_in[i] = self._uses[i] | ( - self._live_out[i] - self._defs[i]) for s in self._successors[i]: self._live_out[i] |= self._live_in[s] - + self._live_in[i] = self._uses[i] | ( + self._live_out[i] - self._defs[i]) if self._reach_fixed_point(live_in, live_out): break -- GitLab From 04f625085d17f3ddd91aa9452617bad86cec675c Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 9 Feb 2018 12:52:28 +0800 Subject: [PATCH 28/55] Fix CI --- paddle/framework/mixed_vector.h | 37 ++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/paddle/framework/mixed_vector.h b/paddle/framework/mixed_vector.h index 2a80079695f..fe9d8a44a5f 100644 --- a/paddle/framework/mixed_vector.h +++ b/paddle/framework/mixed_vector.h @@ -30,26 +30,35 @@ class Vector { public: using value_type = T; - Vector() { - size_ = 0; - flag_ = kDataInCPU; - } + Vector() { InitEmpty(); } explicit Vector(size_t count, const T& value = T()) { - resize(count); - T* ptr = begin(); - for (size_t i = 0; i < count; ++i) { - ptr[i] = value; + if (count == 0) { + InitEmpty(); + } else { + resize(count); + T* ptr = begin(); + for (size_t i = 0; i < count; ++i) { + ptr[i] = value; + } } } Vector(std::initializer_list init) { - InitByIter(init.size(), init.begin(), init.end()); + if (init.size() == 0) { + InitEmpty(); + } else { + InitByIter(init.size(), init.begin(), init.end()); + } } template Vector(const std::vector& dat) { // NOLINT - InitByIter(dat.size(), dat.begin(), dat.end()); + if (dat.size() == 0) { + InitEmpty(); + } else { + InitByIter(dat.size(), dat.begin(), dat.end()); + } } Vector(const Vector& other) { this->operator=(other); } @@ -58,8 +67,7 @@ class Vector { if (other.size() != 0) { this->InitByIter(other.size(), other.begin(), other.end()); } else { - size_ = 0; - flag_ = kDataInCPU; + InitEmpty(); } return *this; } @@ -218,6 +226,11 @@ class Vector { } private: + void InitEmpty() { + size_ = 0; + flag_ = kDataInCPU; + } + template void InitByIter(size_t size, Iter begin, Iter end) { platform::Place cpu = platform::CPUPlace(); -- GitLab From 02d494c3f0999ce3f5bd0f0cae53540a75c0967e Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 9 Feb 2018 13:11:15 +0800 Subject: [PATCH 29/55] Polish code and add comments --- paddle/framework/mixed_vector.h | 70 ++++++++++++++++++++++++--------- paddle/framework/tensor.h | 5 +-- paddle/framework/tensor_impl.h | 4 +- 3 files changed, 54 insertions(+), 25 deletions(-) diff --git a/paddle/framework/mixed_vector.h b/paddle/framework/mixed_vector.h index fe9d8a44a5f..d388da4f2c7 100644 --- a/paddle/framework/mixed_vector.h +++ b/paddle/framework/mixed_vector.h @@ -25,13 +25,17 @@ namespace paddle { namespace framework { +// Vector implements the std::vector interface, and can get Data or +// MutableData from any place. The data will be synced implicitly inside. template class Vector { public: using value_type = T; + // Default ctor. Create empty Vector Vector() { InitEmpty(); } + // Fill vector with value. The vector size is `count`. explicit Vector(size_t count, const T& value = T()) { if (count == 0) { InitEmpty(); @@ -44,6 +48,7 @@ class Vector { } } + // Ctor with init_list Vector(std::initializer_list init) { if (init.size() == 0) { InitEmpty(); @@ -52,6 +57,7 @@ class Vector { } } + // implicit cast from std::vector. template Vector(const std::vector& dat) { // NOLINT if (dat.size() == 0) { @@ -61,8 +67,10 @@ class Vector { } } + // Copy ctor Vector(const Vector& other) { this->operator=(other); } + // Copy operator Vector& operator=(const Vector& other) { if (other.size() != 0) { this->InitByIter(other.size(), other.begin(), other.end()); @@ -72,27 +80,31 @@ class Vector { return *this; } + // Move ctor Vector(Vector&& other) { this->size_ = other.size_; this->flag_ = other.flag_; - if (other.cuda_vec_.capacity()) { + if (other.cuda_vec_.memory_size()) { this->cuda_vec_.ShareDataWith(other.cuda_vec_); } - if (other.cpu_vec_.capacity()) { + if (other.cpu_vec_.memory_size()) { this->cpu_vec_.ShareDataWith(other.cpu_vec_); } } + // CPU data access method. Mutable. T& operator[](size_t i) { MutableCPU(); return const_cast(cpu_vec_.data())[i]; } + // CPU data access method. Immutable. const T& operator[](size_t i) const { ImmutableCPU(); return cpu_vec_.data()[i]; } + // std::vector iterator methods. Based on CPU data access method size_t size() const { return size_; } T* begin() { return &this->operator[](0); } @@ -116,17 +128,22 @@ class Vector { return *it; } + T* data() { return begin(); } + + const T* data() const { return begin(); } + const T& front() const { return *begin(); } + // end of std::vector iterator methods + // assign this from iterator. + // NOTE: the iterator must support `end-begin` template void assign(Iter begin, Iter end) { InitByIter(end - begin, begin, end); } - T* data() { return begin(); } - - const T* data() const { return begin(); } - + // push_back. If the previous capacity is not enough, the memory will + // double. void push_back(T elem) { if (size_ + 1 > capacity()) { reserve((size_ + 1) << 1); @@ -135,6 +152,19 @@ class Vector { ++size_; } + // extend a vector by iterator. + // NOTE: the iterator must support end-begin + template + void Extend(It begin, It end) { + size_t pre_size = size_; + resize(pre_size + (end - begin)); + T* ptr = this->begin() + pre_size; + for (; begin < end; ++begin, ++ptr) { + *ptr = *begin; + } + } + + // resize the vector void resize(size_t size) { if (size + 1 < capacity()) { size_ = size; @@ -145,7 +175,7 @@ class Vector { T* ptr = cpu_tensor.mutable_data( framework::make_ddim({static_cast(size)}), cpu); const T* old_ptr = - cpu_vec_.capacity() == 0 ? nullptr : cpu_vec_.data(); + cpu_vec_.memory_size() == 0 ? nullptr : cpu_vec_.data(); if (old_ptr != nullptr) { std::copy(old_ptr, old_ptr + size_, ptr); } @@ -154,6 +184,7 @@ class Vector { } } + // get cuda ptr. immutable const T* CUDAData(platform::Place place) const { PADDLE_ENFORCE(platform::is_gpu_place(place), "CUDA Data must on CUDA place"); @@ -161,37 +192,31 @@ class Vector { return cuda_vec_.data(); } + // get cuda ptr. mutable T* CUDAMutableData(platform::Place place) { const T* ptr = CUDAData(place); flag_ = kDirty | kDataInCUDA; return const_cast(ptr); } - template - void Extend(It begin, It end) { - size_t pre_size = size_; - resize(pre_size + (end - begin)); - T* ptr = this->begin() + pre_size; - for (; begin < end; ++begin, ++ptr) { - *ptr = *begin; - } - } - + // clear void clear() { size_ = 0; flag_ = kDirty | kDataInCPU; } size_t capacity() const { - return cpu_vec_.capacity() / SizeOfType(typeid(T)); + return cpu_vec_.memory_size() / SizeOfType(typeid(T)); } + // reserve data void reserve(size_t size) { size_t pre_size = size_; resize(size); resize(pre_size); } + // the unify method to access CPU or CUDA data. immutable. const T* Data(platform::Place place) const { if (platform::is_gpu_place(place)) { return CUDAData(place); @@ -200,6 +225,7 @@ class Vector { } } + // the unify method to access CPU or CUDA data. mutable. T* MutableData(platform::Place place) { if (platform::is_gpu_place(place)) { return CUDAMutableData(place); @@ -208,6 +234,7 @@ class Vector { } } + // implicit cast operator. Vector can be cast to std::vector implicitly. operator std::vector() const { std::vector result; result.resize(size()); @@ -243,7 +270,12 @@ class Vector { size_ = size; } - enum DataFlag { kDataInCPU = 0x01, kDataInCUDA = 0x02, kDirty = 0x10 }; + enum DataFlag { + kDataInCPU = 0x01, + kDataInCUDA = 0x02, + // kDirty means the data has been changed in one device. + kDirty = 0x10 + }; void MutableCPU() { if (IsInCUDA() && IsDirty()) { diff --git a/paddle/framework/tensor.h b/paddle/framework/tensor.h index a8767a75430..be09b7c9450 100644 --- a/paddle/framework/tensor.h +++ b/paddle/framework/tensor.h @@ -120,6 +120,7 @@ class Tensor { return holder_->type(); } + // memory size returns the holding memory size in byte. size_t memory_size() const; inline void check_memory_size() const; @@ -128,10 +129,6 @@ class Tensor { inline void set_layout(const DataLayout layout) { layout_ = layout; } - size_t capacity() const { - return holder_ == nullptr ? 0UL : holder_->size() - offset_; - } - private: friend class LoDTensor; diff --git a/paddle/framework/tensor_impl.h b/paddle/framework/tensor_impl.h index 6dcaa024245..f75cc31b399 100644 --- a/paddle/framework/tensor_impl.h +++ b/paddle/framework/tensor_impl.h @@ -62,14 +62,14 @@ inline void Tensor::check_memory_size() const { PADDLE_ENFORCE_NOT_NULL( holder_, "Tensor holds no memory. Call Tensor::mutable_data first."); PADDLE_ENFORCE_GE( - holder_->size(), memory_size() + offset_, + numel() * SizeOfType(type()), memory_size(), "Tensor's dims_ is out of bound. Call Tensor::mutable_data " "first to re-allocate memory.\n" "or maybe the required data-type mismatches the data already stored."); } inline size_t Tensor::memory_size() const { - return holder_ == nullptr ? 0UL : numel() * SizeOfType(type()); + return holder_ == nullptr ? 0UL : holder_->size() - offset_; } template -- GitLab From 9b743b855c6a1ccde54d8b7e359a448a48fc1afb Mon Sep 17 00:00:00 2001 From: guosheng Date: Fri, 9 Feb 2018 13:15:32 +0800 Subject: [PATCH 30/55] Small fix of fluid __init__ --- python/paddle/v2/fluid/__init__.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/python/paddle/v2/fluid/__init__.py b/python/paddle/v2/fluid/__init__.py index 03178ecdcbc..73acbf3e009 100644 --- a/python/paddle/v2/fluid/__init__.py +++ b/python/paddle/v2/fluid/__init__.py @@ -41,11 +41,26 @@ import profiler Tensor = LoDTensor __all__ = framework.__all__ + executor.__all__ + [ - 'io', 'initializer', 'layers', 'nets', 'optimizer', 'learning_rate_decay', - 'backward', 'regularizer', 'LoDTensor', 'CPUPlace', 'CUDAPlace', 'Tensor', - 'ParamAttr', 'WeightNormParamAttr', 'DataFeeder', 'clip', - 'SimpleDistributeTranspiler', 'DistributeTranspiler', 'memory_optimize', - 'profiler' + 'io', + 'initializer', + 'layers', + 'nets', + 'optimizer', + 'learning_rate_decay', + 'backward', + 'regularizer', + 'LoDTensor', + 'CPUPlace', + 'CUDAPlace', + 'Tensor', + 'ParamAttr', + 'WeightNormParamAttr', + 'DataFeeder', + 'clip', + 'SimpleDistributeTranspiler', + 'DistributeTranspiler', + 'memory_optimize', + 'profiler', ] -- GitLab From 1185a1b5ab897133585ffdcef8f68d0ee6caef46 Mon Sep 17 00:00:00 2001 From: Yiqun Liu Date: Fri, 9 Feb 2018 13:27:42 +0800 Subject: [PATCH 31/55] Add C++ inference unittest of recommender system (#8227) * Save the inference model in Python example of recommender_system. * Add infer() in Python unittest recommender_system. * Add C++ inference unittest of recommender_system. --- paddle/inference/tests/book/CMakeLists.txt | 1 + paddle/inference/tests/book/test_helper.h | 33 +++- .../test_inference_image_classification.cc | 14 +- .../test_inference_label_semantic_roles.cc | 6 +- .../book/test_inference_recognize_digits.cc | 18 ++- .../book/test_inference_recommender_system.cc | 87 +++++++++++ .../test_inference_rnn_encoder_decoder.cc | 6 +- python/paddle/v2/fluid/tests/book/.gitignore | 2 +- .../fluid/tests/book/test_recognize_digits.py | 3 +- .../tests/book/test_recommender_system.py | 146 +++++++++++++++--- 10 files changed, 266 insertions(+), 50 deletions(-) create mode 100644 paddle/inference/tests/book/test_inference_recommender_system.cc diff --git a/paddle/inference/tests/book/CMakeLists.txt b/paddle/inference/tests/book/CMakeLists.txt index 479f51f1df9..5c866eb1e2e 100644 --- a/paddle/inference/tests/book/CMakeLists.txt +++ b/paddle/inference/tests/book/CMakeLists.txt @@ -28,3 +28,4 @@ inference_test(recognize_digits ARGS mlp) inference_test(image_classification ARGS vgg resnet) inference_test(label_semantic_roles) inference_test(rnn_encoder_decoder) +inference_test(recommender_system) diff --git a/paddle/inference/tests/book/test_helper.h b/paddle/inference/tests/book/test_helper.h index 3e66ced94fe..22ce903c725 100644 --- a/paddle/inference/tests/book/test_helper.h +++ b/paddle/inference/tests/book/test_helper.h @@ -30,6 +30,15 @@ void SetupTensor(paddle::framework::LoDTensor& input, } } +template +void SetupTensor(paddle::framework::LoDTensor& input, + paddle::framework::DDim dims, + std::vector& data) { + CHECK_EQ(paddle::framework::product(dims), data.size()); + T* input_ptr = input.mutable_data(dims, paddle::platform::CPUPlace()); + memcpy(input_ptr, data.data(), input.numel() * sizeof(T)); +} + template void SetupLoDTensor(paddle::framework::LoDTensor& input, paddle::framework::LoD& lod, @@ -37,7 +46,18 @@ void SetupLoDTensor(paddle::framework::LoDTensor& input, T upper) { input.set_lod(lod); int dim = lod[0][lod[0].size() - 1]; - SetupTensor(input, {dim, 1}, lower, upper); + SetupTensor(input, {dim, 1}, lower, upper); +} + +template +void SetupLoDTensor(paddle::framework::LoDTensor& input, + paddle::framework::DDim dims, + paddle::framework::LoD lod, + std::vector& data) { + const size_t level = lod.size() - 1; + CHECK_EQ(dims[0], (lod[level]).back()); + input.set_lod(lod); + SetupTensor(input, dims, data); } template @@ -67,7 +87,7 @@ void CheckError(paddle::framework::LoDTensor& output1, EXPECT_EQ(count, 0) << "There are " << count << " different elements."; } -template +template void TestInference(const std::string& dirname, const std::vector& cpu_feeds, std::vector& cpu_fetchs) { @@ -75,11 +95,13 @@ void TestInference(const std::string& dirname, auto place = Place(); auto executor = paddle::framework::Executor(place); auto* scope = new paddle::framework::Scope(); - std::unique_ptr inference_program; - // 2. Initialize the inference_program and load all parameters from file + // 2. Initialize the inference_program and load parameters + std::unique_ptr inference_program; if (IsCombined) { - // Hard-coding the names for combined params case + // All parameters are saved in a single file. + // Hard-coding the file names of program and parameters in unittest. + // Users are free to specify different filename. std::string prog_filename = "__model_combined__"; std::string param_filename = "__params_combined__"; inference_program = paddle::inference::Load(executor, @@ -87,6 +109,7 @@ void TestInference(const std::string& dirname, dirname + "/" + prog_filename, dirname + "/" + param_filename); } else { + // Parameters are saved in separate files sited in the specified `dirname`. inference_program = paddle::inference::Load(executor, *scope, dirname); } diff --git a/paddle/inference/tests/book/test_inference_image_classification.cc b/paddle/inference/tests/book/test_inference_image_classification.cc index 35ff9431e97..36ea7c77a75 100644 --- a/paddle/inference/tests/book/test_inference_image_classification.cc +++ b/paddle/inference/tests/book/test_inference_image_classification.cc @@ -29,11 +29,15 @@ TEST(inference, image_classification) { // 0. Call `paddle::framework::InitDevices()` initialize all the devices // In unittests, this is done in paddle/testing/paddle_gtest_main.cc + int64_t batch_size = 1; + paddle::framework::LoDTensor input; // Use normilized image pixels as input data, // which should be in the range [0.0, 1.0]. - SetupTensor( - input, {1, 3, 32, 32}, static_cast(0), static_cast(1)); + SetupTensor(input, + {batch_size, 3, 32, 32}, + static_cast(0), + static_cast(1)); std::vector cpu_feeds; cpu_feeds.push_back(&input); @@ -42,8 +46,7 @@ TEST(inference, image_classification) { cpu_fetchs1.push_back(&output1); // Run inference on CPU - TestInference( - dirname, cpu_feeds, cpu_fetchs1); + TestInference(dirname, cpu_feeds, cpu_fetchs1); LOG(INFO) << output1.dims(); #ifdef PADDLE_WITH_CUDA @@ -52,8 +55,7 @@ TEST(inference, image_classification) { cpu_fetchs2.push_back(&output2); // Run inference on CUDA GPU - TestInference( - dirname, cpu_feeds, cpu_fetchs2); + TestInference(dirname, cpu_feeds, cpu_fetchs2); LOG(INFO) << output2.dims(); CheckError(output1, output2); diff --git a/paddle/inference/tests/book/test_inference_label_semantic_roles.cc b/paddle/inference/tests/book/test_inference_label_semantic_roles.cc index 1eaf4022a1f..922dbfd3338 100644 --- a/paddle/inference/tests/book/test_inference_label_semantic_roles.cc +++ b/paddle/inference/tests/book/test_inference_label_semantic_roles.cc @@ -58,8 +58,7 @@ TEST(inference, label_semantic_roles) { cpu_fetchs1.push_back(&output1); // Run inference on CPU - TestInference( - dirname, cpu_feeds, cpu_fetchs1); + TestInference(dirname, cpu_feeds, cpu_fetchs1); LOG(INFO) << output1.lod(); LOG(INFO) << output1.dims(); @@ -69,8 +68,7 @@ TEST(inference, label_semantic_roles) { cpu_fetchs2.push_back(&output2); // Run inference on CUDA GPU - TestInference( - dirname, cpu_feeds, cpu_fetchs2); + TestInference(dirname, cpu_feeds, cpu_fetchs2); LOG(INFO) << output2.lod(); LOG(INFO) << output2.dims(); diff --git a/paddle/inference/tests/book/test_inference_recognize_digits.cc b/paddle/inference/tests/book/test_inference_recognize_digits.cc index 3a48db7fe08..af8c2b14c3b 100644 --- a/paddle/inference/tests/book/test_inference_recognize_digits.cc +++ b/paddle/inference/tests/book/test_inference_recognize_digits.cc @@ -29,11 +29,15 @@ TEST(inference, recognize_digits) { // 0. Call `paddle::framework::InitDevices()` initialize all the devices // In unittests, this is done in paddle/testing/paddle_gtest_main.cc + int64_t batch_size = 1; + paddle::framework::LoDTensor input; // Use normilized image pixels as input data, // which should be in the range [-1.0, 1.0]. - SetupTensor( - input, {1, 28, 28}, static_cast(-1), static_cast(1)); + SetupTensor(input, + {batch_size, 1, 28, 28}, + static_cast(-1), + static_cast(1)); std::vector cpu_feeds; cpu_feeds.push_back(&input); @@ -42,8 +46,7 @@ TEST(inference, recognize_digits) { cpu_fetchs1.push_back(&output1); // Run inference on CPU - TestInference( - dirname, cpu_feeds, cpu_fetchs1); + TestInference(dirname, cpu_feeds, cpu_fetchs1); LOG(INFO) << output1.dims(); #ifdef PADDLE_WITH_CUDA @@ -52,8 +55,7 @@ TEST(inference, recognize_digits) { cpu_fetchs2.push_back(&output2); // Run inference on CUDA GPU - TestInference( - dirname, cpu_feeds, cpu_fetchs2); + TestInference(dirname, cpu_feeds, cpu_fetchs2); LOG(INFO) << output2.dims(); CheckError(output1, output2); @@ -84,7 +86,7 @@ TEST(inference, recognize_digits_combine) { cpu_fetchs1.push_back(&output1); // Run inference on CPU - TestInference( + TestInference( dirname, cpu_feeds, cpu_fetchs1); LOG(INFO) << output1.dims(); @@ -94,7 +96,7 @@ TEST(inference, recognize_digits_combine) { cpu_fetchs2.push_back(&output2); // Run inference on CUDA GPU - TestInference( + TestInference( dirname, cpu_feeds, cpu_fetchs2); LOG(INFO) << output2.dims(); diff --git a/paddle/inference/tests/book/test_inference_recommender_system.cc b/paddle/inference/tests/book/test_inference_recommender_system.cc new file mode 100644 index 00000000000..ec24c7e6ab7 --- /dev/null +++ b/paddle/inference/tests/book/test_inference_recommender_system.cc @@ -0,0 +1,87 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include +#include "gflags/gflags.h" +#include "test_helper.h" + +DEFINE_string(dirname, "", "Directory of the inference model."); + +TEST(inference, recommender_system) { + if (FLAGS_dirname.empty()) { + LOG(FATAL) << "Usage: ./example --dirname=path/to/your/model"; + } + + LOG(INFO) << "FLAGS_dirname: " << FLAGS_dirname << std::endl; + std::string dirname = FLAGS_dirname; + + // 0. Call `paddle::framework::InitDevices()` initialize all the devices + // In unittests, this is done in paddle/testing/paddle_gtest_main.cc + + int64_t batch_size = 1; + + paddle::framework::LoDTensor user_id, gender_id, age_id, job_id, movie_id, + category_id, movie_title; + + // Use the first data from paddle.dataset.movielens.test() as input + std::vector user_id_data = {1}; + SetupTensor(user_id, {batch_size, 1}, user_id_data); + + std::vector gender_id_data = {1}; + SetupTensor(gender_id, {batch_size, 1}, gender_id_data); + + std::vector age_id_data = {0}; + SetupTensor(age_id, {batch_size, 1}, age_id_data); + + std::vector job_id_data = {10}; + SetupTensor(job_id, {batch_size, 1}, job_id_data); + + std::vector movie_id_data = {783}; + SetupTensor(movie_id, {batch_size, 1}, movie_id_data); + + std::vector category_id_data = {10, 8, 9}; + SetupLoDTensor(category_id, {3, 1}, {{0, 3}}, category_id_data); + + std::vector movie_title_data = {1069, 4140, 2923, 710, 988}; + SetupLoDTensor(movie_title, {5, 1}, {{0, 5}}, movie_title_data); + + std::vector cpu_feeds; + cpu_feeds.push_back(&user_id); + cpu_feeds.push_back(&gender_id); + cpu_feeds.push_back(&age_id); + cpu_feeds.push_back(&job_id); + cpu_feeds.push_back(&movie_id); + cpu_feeds.push_back(&category_id); + cpu_feeds.push_back(&movie_title); + + paddle::framework::LoDTensor output1; + std::vector cpu_fetchs1; + cpu_fetchs1.push_back(&output1); + + // Run inference on CPU + TestInference(dirname, cpu_feeds, cpu_fetchs1); + LOG(INFO) << output1.dims(); + +#ifdef PADDLE_WITH_CUDA + paddle::framework::LoDTensor output2; + std::vector cpu_fetchs2; + cpu_fetchs2.push_back(&output2); + + // Run inference on CUDA GPU + TestInference(dirname, cpu_feeds, cpu_fetchs2); + LOG(INFO) << output2.dims(); + + CheckError(output1, output2); +#endif +} diff --git a/paddle/inference/tests/book/test_inference_rnn_encoder_decoder.cc b/paddle/inference/tests/book/test_inference_rnn_encoder_decoder.cc index 9bfc0407b7f..248b9dce217 100644 --- a/paddle/inference/tests/book/test_inference_rnn_encoder_decoder.cc +++ b/paddle/inference/tests/book/test_inference_rnn_encoder_decoder.cc @@ -46,8 +46,7 @@ TEST(inference, rnn_encoder_decoder) { cpu_fetchs1.push_back(&output1); // Run inference on CPU - TestInference( - dirname, cpu_feeds, cpu_fetchs1); + TestInference(dirname, cpu_feeds, cpu_fetchs1); LOG(INFO) << output1.lod(); LOG(INFO) << output1.dims(); @@ -57,8 +56,7 @@ TEST(inference, rnn_encoder_decoder) { cpu_fetchs2.push_back(&output2); // Run inference on CUDA GPU - TestInference( - dirname, cpu_feeds, cpu_fetchs2); + TestInference(dirname, cpu_feeds, cpu_fetchs2); LOG(INFO) << output2.lod(); LOG(INFO) << output2.dims(); diff --git a/python/paddle/v2/fluid/tests/book/.gitignore b/python/paddle/v2/fluid/tests/book/.gitignore index f0b574b9396..dd28d354f41 100644 --- a/python/paddle/v2/fluid/tests/book/.gitignore +++ b/python/paddle/v2/fluid/tests/book/.gitignore @@ -1 +1 @@ -recognize_digits_*.inference.model +*.inference.model diff --git a/python/paddle/v2/fluid/tests/book/test_recognize_digits.py b/python/paddle/v2/fluid/tests/book/test_recognize_digits.py index 6f9d85faff9..244c1749cd5 100644 --- a/python/paddle/v2/fluid/tests/book/test_recognize_digits.py +++ b/python/paddle/v2/fluid/tests/book/test_recognize_digits.py @@ -174,8 +174,9 @@ def infer(use_cuda, save_dirname=None, param_filename=None): # The input's dimension of conv should be 4-D or 5-D. # Use normilized image pixels as input data, which should be in the range [-1.0, 1.0]. + batch_size = 1 tensor_img = numpy.random.uniform(-1.0, 1.0, - [1, 1, 28, 28]).astype("float32") + [batch_size, 1, 28, 28]).astype("float32") # Construct feed as a dictionary of {feed_target_name: feed_target_data} # and results will contain a list of data corresponding to fetch_targets. diff --git a/python/paddle/v2/fluid/tests/book/test_recommender_system.py b/python/paddle/v2/fluid/tests/book/test_recommender_system.py index 9c7ab7d6318..612d51e08e4 100644 --- a/python/paddle/v2/fluid/tests/book/test_recommender_system.py +++ b/python/paddle/v2/fluid/tests/book/test_recommender_system.py @@ -16,7 +16,7 @@ import math import sys import numpy as np import paddle.v2 as paddle -import paddle.v2.fluid.core as core +import paddle.v2.fluid as fluid import paddle.v2.fluid.framework as framework import paddle.v2.fluid.layers as layers import paddle.v2.fluid.nets as nets @@ -104,7 +104,8 @@ def get_mov_combined_features(): CATEGORY_DICT_SIZE = len(paddle.dataset.movielens.movie_categories()) - category_id = layers.data(name='category_id', shape=[1], dtype='int64') + category_id = layers.data( + name='category_id', shape=[1], dtype='int64', lod_level=1) mov_categories_emb = layers.embedding( input=category_id, size=[CATEGORY_DICT_SIZE, 32], is_sparse=IS_SPARSE) @@ -114,7 +115,8 @@ def get_mov_combined_features(): MOV_TITLE_DICT_SIZE = len(paddle.dataset.movielens.get_movie_title_dict()) - mov_title_id = layers.data(name='movie_title', shape=[1], dtype='int64') + mov_title_id = layers.data( + name='movie_title', shape=[1], dtype='int64', lod_level=1) mov_title_emb = layers.embedding( input=mov_title_id, size=[MOV_TITLE_DICT_SIZE, 32], is_sparse=IS_SPARSE) @@ -144,23 +146,22 @@ def model(): scale_infer = layers.scale(x=inference, scale=5.0) label = layers.data(name='score', shape=[1], dtype='float32') - square_cost = layers.square_error_cost(input=scale_infer, label=label) - avg_cost = layers.mean(x=square_cost) - return avg_cost + return scale_infer, avg_cost + +def train(use_cuda, save_dirname): + scale_infer, avg_cost = model() + + # test program + test_program = fluid.default_main_program().clone() -def main(): - cost = model() sgd_optimizer = SGDOptimizer(learning_rate=0.2) - opts = sgd_optimizer.minimize(cost) + opts = sgd_optimizer.minimize(avg_cost) - if USE_GPU: - place = core.CUDAPlace(0) - else: - place = core.CPUPlace() + place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace() exe = Executor(place) exe.run(framework.default_startup_program()) @@ -169,6 +170,8 @@ def main(): paddle.reader.shuffle( paddle.dataset.movielens.train(), buf_size=8192), batch_size=BATCH_SIZE) + test_reader = paddle.batch( + paddle.dataset.movielens.test(), batch_size=BATCH_SIZE) feeding = { 'user_id': 0, @@ -184,7 +187,7 @@ def main(): def func_feed(feeding, data): feed_tensors = {} for (key, idx) in feeding.iteritems(): - tensor = core.LoDTensor() + tensor = fluid.LoDTensor() if key != "category_id" and key != "movie_title": if key == "score": numpy_data = np.array(map(lambda x: x[idx], data)).astype( @@ -211,16 +214,117 @@ def main(): PASS_NUM = 100 for pass_id in range(PASS_NUM): - for data in train_reader(): - outs = exe.run(framework.default_main_program(), + for batch_id, data in enumerate(train_reader()): + # train a mini-batch + outs = exe.run(program=fluid.default_main_program(), feed=func_feed(feeding, data), - fetch_list=[cost]) + fetch_list=[avg_cost]) out = np.array(outs[0]) - if out[0] < 6.0: - # if avg cost less than 6.0, we think our code is good. - exit(0) + if (batch_id + 1) % 10 == 0: + avg_cost_set = [] + for test_data in test_reader(): + avg_cost_np = exe.run(program=test_program, + feed=func_feed(feeding, test_data), + fetch_list=[avg_cost]) + avg_cost_set.append(avg_cost_np[0]) + break # test only 1 segment for speeding up CI + + # get test avg_cost + test_avg_cost = np.array(avg_cost_set).mean() + if test_avg_cost < 6.0: + # if avg_cost less than 6.0, we think our code is good. + if save_dirname is not None: + fluid.io.save_inference_model(save_dirname, [ + "user_id", "gender_id", "age_id", "job_id", + "movie_id", "category_id", "movie_title" + ], [scale_infer], exe) + return + if math.isnan(float(out[0])): sys.exit("got NaN loss, training failed.") -main() +def infer(use_cuda, save_dirname=None): + if save_dirname is None: + return + + place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace() + exe = fluid.Executor(place) + + # Use fluid.io.load_inference_model to obtain the inference program desc, + # the feed_target_names (the names of variables that will be feeded + # data using feed operators), and the fetch_targets (variables that + # we want to obtain data from using fetch operators). + [inference_program, feed_target_names, + fetch_targets] = fluid.io.load_inference_model(save_dirname, exe) + + def create_lod_tensor(data, lod=None): + tensor = fluid.LoDTensor() + if lod is None: + # Tensor, the shape is [batch_size, 1] + index = 0 + lod_0 = [index] + for l in range(len(data)): + index += 1 + lod_0.append(index) + lod = [lod_0] + tensor.set_lod(lod) + + flattened_data = np.concatenate(data, axis=0).astype("int64") + flattened_data = flattened_data.reshape([len(flattened_data), 1]) + tensor.set(flattened_data, place) + return tensor + + # Use the first data from paddle.dataset.movielens.test() as input + assert feed_target_names[0] == "user_id" + user_id = create_lod_tensor([[1]]) + + assert feed_target_names[1] == "gender_id" + gender_id = create_lod_tensor([[1]]) + + assert feed_target_names[2] == "age_id" + age_id = create_lod_tensor([[0]]) + + assert feed_target_names[3] == "job_id" + job_id = create_lod_tensor([[10]]) + + assert feed_target_names[4] == "movie_id" + movie_id = create_lod_tensor([[783]]) + + assert feed_target_names[5] == "category_id" + category_id = create_lod_tensor([[10], [8], [9]], [[0, 3]]) + + assert feed_target_names[6] == "movie_title" + movie_title = create_lod_tensor([[1069], [4140], [2923], [710], [988]], + [[0, 5]]) + + # Construct feed as a dictionary of {feed_target_name: feed_target_data} + # and results will contain a list of data corresponding to fetch_targets. + results = exe.run(inference_program, + feed={ + feed_target_names[0]: user_id, + feed_target_names[1]: gender_id, + feed_target_names[2]: age_id, + feed_target_names[3]: job_id, + feed_target_names[4]: movie_id, + feed_target_names[5]: category_id, + feed_target_names[6]: movie_title + }, + fetch_list=fetch_targets, + return_numpy=False) + print("inferred score: ", np.array(results[0])) + + +def main(use_cuda): + if use_cuda and not fluid.core.is_compiled_with_cuda(): + return + + # Directory for saving the inference model + save_dirname = "recommender_system.inference.model" + + train(use_cuda, save_dirname) + infer(use_cuda, save_dirname) + + +if __name__ == '__main__': + main(USE_GPU) -- GitLab From 3c4117106f2bd4f86fd7ab770fb4fba45a91f692 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 9 Feb 2018 13:34:12 +0800 Subject: [PATCH 32/55] Add unittest --- paddle/framework/mixed_vector_test.cu | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/paddle/framework/mixed_vector_test.cu b/paddle/framework/mixed_vector_test.cu index 6adad6c12c3..a037cc3b990 100644 --- a/paddle/framework/mixed_vector_test.cu +++ b/paddle/framework/mixed_vector_test.cu @@ -11,3 +11,81 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#include + +#include "glog/logging.h" +#include "gtest/gtest.h" +#include "paddle/framework/mixed_vector.h" +#include "paddle/platform/gpu_info.h" + +template +using vec = paddle::framework::Vector; + +TEST(mixed_vector, CPU_VECTOR) { + vec tmp; + for (int i = 0; i < 10; ++i) { + tmp.push_back(i); + } + ASSERT_EQ(tmp.size(), 10); + vec tmp2; + tmp2 = tmp; + ASSERT_EQ(tmp2.size(), 10); + for (int i = 0; i < 10; ++i) { + ASSERT_EQ(tmp2[i], i); + ASSERT_EQ(tmp2[i], tmp[i]); + } + int cnt = 0; + for (auto& t : tmp2) { + ASSERT_EQ(t, cnt); + ++cnt; + } +} + +static __global__ void multiply_10(int* ptr) { + for (int i = 0; i < 10; ++i) { + ptr[i] *= 10; + } +} + +cudaStream_t GetCUDAStream(paddle::platform::CUDAPlace place) { + return reinterpret_cast( + paddle::platform::DeviceContextPool::Instance().Get(place)) + ->stream(); +} + +TEST(mixed_vector, GPU_VECTOR) { + vec tmp; + for (int i = 0; i < 10; ++i) { + tmp.push_back(i); + } + ASSERT_EQ(tmp.size(), 10); + paddle::platform::CUDAPlace gpu(0); + + multiply_10<<<1, 1, 0, GetCUDAStream(gpu)>>>(tmp.MutableData(gpu)); + + for (int i = 0; i < 10; ++i) { + ASSERT_EQ(tmp[i], i * 10); + } +} + +TEST(mixed_vector, MultiGPU) { + if (paddle::platform::GetCUDADeviceCount() < 2) { + LOG(WARNING) << "Skip mixed_vector.MultiGPU since there are not multiple " + "GPUs in your machine."; + return; + } + + vec tmp; + for (int i = 0; i < 10; ++i) { + tmp.push_back(i); + } + ASSERT_EQ(tmp.size(), 10); + paddle::platform::CUDAPlace gpu0(0); + multiply_10<<<1, 1, 0, GetCUDAStream(gpu0)>>>(tmp.MutableData(gpu0)); + paddle::platform::CUDAPlace gpu1(1); + multiply_10<<<1, 1, 0, GetCUDAStream(gpu1)>>>(tmp.MutableData(gpu1)); + + for (int i = 0; i < 10; ++i) { + ASSERT_EQ(tmp[i], i * 100); + } +} -- GitLab From 12246a9d8168978452298af20b5cc1453360c12e Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 9 Feb 2018 13:40:58 +0800 Subject: [PATCH 33/55] Fix typo --- paddle/framework/tensor_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/framework/tensor_impl.h b/paddle/framework/tensor_impl.h index f75cc31b399..652d6b8a90e 100644 --- a/paddle/framework/tensor_impl.h +++ b/paddle/framework/tensor_impl.h @@ -61,7 +61,7 @@ static inline size_t SizeOfType(std::type_index type) { inline void Tensor::check_memory_size() const { PADDLE_ENFORCE_NOT_NULL( holder_, "Tensor holds no memory. Call Tensor::mutable_data first."); - PADDLE_ENFORCE_GE( + PADDLE_ENFORCE_LE( numel() * SizeOfType(type()), memory_size(), "Tensor's dims_ is out of bound. Call Tensor::mutable_data " "first to re-allocate memory.\n" -- GitLab From a063fc28b6993cb59d8eb66ecce8521360314f0b Mon Sep 17 00:00:00 2001 From: guosheng Date: Fri, 9 Feb 2018 14:31:12 +0800 Subject: [PATCH 34/55] Fix the bias of fc when num_flatten_dims is not 1 in fluid layers --- python/paddle/v2/fluid/layers/nn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/v2/fluid/layers/nn.py b/python/paddle/v2/fluid/layers/nn.py index 99168ecc228..eaf02ff589d 100644 --- a/python/paddle/v2/fluid/layers/nn.py +++ b/python/paddle/v2/fluid/layers/nn.py @@ -184,7 +184,7 @@ def fc(input, helper.append_op( type="sum", inputs={"X": mul_results}, outputs={"Out": pre_bias}) # add bias - pre_activation = helper.append_bias_op(pre_bias) + pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims) # add activation return helper.append_activation(pre_activation) -- GitLab From 5135f05cf19c30af52a92637d2270938a0e01585 Mon Sep 17 00:00:00 2001 From: Yancey1989 Date: Fri, 9 Feb 2018 16:05:31 +0800 Subject: [PATCH 35/55] create optimize block in pserver program --- .../paddle/v2/fluid/distribute_transpiler.py | 43 +++++++------------ 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/python/paddle/v2/fluid/distribute_transpiler.py b/python/paddle/v2/fluid/distribute_transpiler.py index c5f1d51bd71..cd89dba72db 100644 --- a/python/paddle/v2/fluid/distribute_transpiler.py +++ b/python/paddle/v2/fluid/distribute_transpiler.py @@ -347,7 +347,8 @@ class DistributeTranspiler: j -= 1 return False - def _append_pserver_ops(self, program, pserver_program, opt_op, endpoint): + def _append_pserver_ops(self, optimize_block, opt_op, endpoint): + program = optimize_block.program new_inputs = dict() # update param/grad shape first, then other inputs like # moment can use the updated shape @@ -371,11 +372,11 @@ class DistributeTranspiler: if self.trainers > 1: vars2merge = self._create_var_for_trainers( program.global_block(), grad_block, self.trainers) - program.global_block().append_op( + optimize_block.append_op( type="sum", inputs={"X": vars2merge}, outputs={"Out": merged_var}) - program.global_block().append_op( + optimize_block.append_op( type="scale", inputs={"X": merged_var}, outputs={"Out": merged_var}, @@ -412,25 +413,18 @@ class DistributeTranspiler: dtype=var.dtype, shape=new_shape) new_inputs[key] = tmpvar - # create var in pserver program global block. - # TODO(typhoonzero): put blocks in one program to avoid create two - # variables. - pserver_program.global_block().create_var( - name=var.name, - persistable=var.persistable, - dtype=var.dtype, - shape=new_shape) # change output's ParamOut variable outputs = self._get_output_map_from_op(program.global_block(), opt_op) outputs["ParamOut"] = new_inputs["Param"] - program.global_block().append_op( + optimize_block.append_op( type=opt_op.type, inputs=new_inputs, outputs=outputs, attrs=opt_op.attrs) - def _append_pserver_non_opt_ops(self, program, pserver_program, opt_op): + def _append_pserver_non_opt_ops(self, optimize_block, opt_op): + program = optimize_block.program # Append the ops for parameters that do not need to be optimized/updated inputs = self._get_input_map_from_op(self.program.global_block().vars, opt_op) @@ -440,14 +434,8 @@ class DistributeTranspiler: else: varlist = [var] for var in varlist: - # TODO(typhoonzero): will remove below line later. - program.global_block().create_var( - name=var.name, - persistable=var.persistable, - dtype=var.dtype, - shape=var.shape) - if not pserver_program.global_block().vars.has_key(var.name): - pserver_program.global_block().create_var( + if not program.global_block().vars.has_key(var.name): + program.global_block().create_var( name=var.name, persistable=var.persistable, dtype=var.dtype, @@ -456,7 +444,7 @@ class DistributeTranspiler: outputs = self._get_output_map_from_op(self.program.global_block().vars, opt_op) - program.global_block().append_op( + optimize_block.append_op( type=opt_op.type, inputs=inputs, outputs=outputs, @@ -489,7 +477,7 @@ class DistributeTranspiler: dtype=v.dtype, shape=v.shape) # step6 - optimize_sub_program = Program() + optimize_block = pserver_program.create_block(0) # Iterate through the ops and append ops as needed for idx, opt_op in enumerate(self.optimize_ops): is_op_on_pserver = self._is_op_on_pserver(endpoint, @@ -497,18 +485,17 @@ class DistributeTranspiler: if not is_op_on_pserver: continue if "Grad" in opt_op.desc.input_arg_names(): - self._append_pserver_ops(optimize_sub_program, pserver_program, - opt_op, endpoint) + self._append_pserver_ops(optimize_block, opt_op, endpoint) else: - self._append_pserver_non_opt_ops(optimize_sub_program, - pserver_program, opt_op) + self._append_pserver_non_opt_ops(optimize_block, opt_op) + # Append the listen_and_serv op pserver_program.global_block().append_op( type="listen_and_serv", inputs={}, outputs={}, attrs={ - "OptimizeBlock": optimize_sub_program.global_block(), + "OptimizeBlock": optimize_block, "endpoint": endpoint, "ParamList": [ p.name -- GitLab From 051ba1ce1dcebb6fcd43e46fff648b323b087fca Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Fri, 9 Feb 2018 16:44:33 +0800 Subject: [PATCH 36/55] Use force cpu in fill constant op (#8254) --- python/paddle/v2/fluid/initializer.py | 37 +++++- .../paddle/v2/fluid/layers/math_op_patch.py | 10 +- python/paddle/v2/fluid/layers/tensor.py | 27 ++++- python/paddle/v2/fluid/learning_rate_decay.py | 114 ++++++++++-------- .../tests/book/test_label_semantic_roles.py | 12 +- 5 files changed, 138 insertions(+), 62 deletions(-) diff --git a/python/paddle/v2/fluid/initializer.py b/python/paddle/v2/fluid/initializer.py index b9c0d12ad6c..8c70fd90eff 100644 --- a/python/paddle/v2/fluid/initializer.py +++ b/python/paddle/v2/fluid/initializer.py @@ -14,14 +14,37 @@ import framework import numpy as np +import contextlib __all__ = [ - 'Constant', - 'Uniform', - 'Normal', - 'Xavier', + 'Constant', 'Uniform', 'Normal', 'Xavier', 'force_init_on_cpu', + 'init_on_cpu' ] +_force_init_on_cpu_ = False + + +def force_init_on_cpu(): + return _force_init_on_cpu_ + + +@contextlib.contextmanager +def init_on_cpu(): + """ + Switch program with `with` statement + + Examples: + >>> with init_on_cpu(): + >>> step = layers.create_global_var() + + """ + global _force_init_on_cpu_ + + pre_state = force_init_on_cpu() + _force_init_on_cpu_ = True + yield + _force_init_on_cpu_ = pre_state + class Initializer(object): """Base class for variable initializers @@ -80,7 +103,7 @@ class ConstantInitializer(Initializer): """Implements the constant initializer """ - def __init__(self, value=0.0): + def __init__(self, value=0.0, force_cpu=False): """Constructor for ConstantInitializer Args: @@ -89,6 +112,7 @@ class ConstantInitializer(Initializer): assert value is not None super(ConstantInitializer, self).__init__() self._value = value + self._force_cpu = force_cpu def __call__(self, var, block): """Add constant initialization ops for a variable @@ -110,7 +134,8 @@ class ConstantInitializer(Initializer): attrs={ "shape": var.shape, "dtype": int(var.dtype), - "value": self._value + "value": float(self._value), + 'force_cpu': self._force_cpu or force_init_on_cpu() }) var.op = op return op diff --git a/python/paddle/v2/fluid/layers/math_op_patch.py b/python/paddle/v2/fluid/layers/math_op_patch.py index 79a130a3eb1..9b5f22759cf 100644 --- a/python/paddle/v2/fluid/layers/math_op_patch.py +++ b/python/paddle/v2/fluid/layers/math_op_patch.py @@ -14,6 +14,7 @@ from ..framework import Variable, unique_name from layer_function_generator import OpProtoHolder +from ..initializer import force_init_on_cpu __all__ = ['monkey_patch_variable'] @@ -36,9 +37,12 @@ def monkey_patch_variable(): block.append_op( type="fill_constant", outputs={'Out': [var]}, - attrs={'dtype': var.dtype, - 'shape': shape, - 'value': value}) + attrs={ + 'dtype': var.dtype, + 'shape': shape, + 'value': value, + 'force_cpu': force_init_on_cpu() + }) return var def create_scalar(block, value, dtype): diff --git a/python/paddle/v2/fluid/layers/tensor.py b/python/paddle/v2/fluid/layers/tensor.py index 704e040b9f4..2d4e0ab0cc6 100644 --- a/python/paddle/v2/fluid/layers/tensor.py +++ b/python/paddle/v2/fluid/layers/tensor.py @@ -16,7 +16,7 @@ from ..layer_helper import LayerHelper from ..param_attr import ParamAttr from ..framework import convert_np_dtype_to_dtype_ from ..framework import Variable -from ..initializer import Constant +from ..initializer import Constant, force_init_on_cpu from ..core import DataType import numpy @@ -69,12 +69,30 @@ def create_parameter(shape, default_initializer) -def create_global_var(shape, value, dtype, persistable=False, name=None): +def create_global_var(shape, + value, + dtype, + persistable=False, + force_cpu=False, + name=None): + """ + Create a global variable. such as global_step + Args: + shape(list[int]): shape of the variable + value(float): the value of the variable + dtype(string): element type of the parameter + persistable(bool): if this variable is persistable + force_cpu(bool): force this variable to be on CPU + + Returns: + Variable: the created Variable + """ helper = LayerHelper("global_var", **locals()) var = helper.create_global_variable( dtype=dtype, shape=shape, persistable=persistable, name=name) helper.set_variable_initializer( - var, initializer=Constant(value=float(value))) + var, initializer=Constant( + value=float(value), force_cpu=force_cpu)) return var @@ -221,6 +239,7 @@ def fill_constant(shape, dtype, value, force_cpu=False, out=None): dtype(np.dtype|core.DataType|str): Data type of the output tensor. value(float): The constant value used to initialize the output tensor. out(Variable): The output tensor. + force_cpu(True|False): data should be on CPU if set true. Returns: Variable: The tensor variable storing the output. @@ -242,7 +261,7 @@ def fill_constant(shape, dtype, value, force_cpu=False, out=None): 'shape': shape, 'dtype': out.dtype, 'value': float(value), - 'force_cpu': force_cpu + 'force_cpu': force_cpu or force_init_on_cpu() }) out.stop_gradient = True return out diff --git a/python/paddle/v2/fluid/learning_rate_decay.py b/python/paddle/v2/fluid/learning_rate_decay.py index 13dc98075f7..2a2a29fd9cb 100644 --- a/python/paddle/v2/fluid/learning_rate_decay.py +++ b/python/paddle/v2/fluid/learning_rate_decay.py @@ -14,6 +14,7 @@ import layers from framework import Variable +from initializer import init_on_cpu __all__ = [ 'exponential_decay', 'natural_exp_decay', 'inverse_time_decay', @@ -54,11 +55,14 @@ def exponential_decay(learning_rate, if not isinstance(global_step, Variable): raise ValueError("global_step is required for exponential_decay.") - # update learning_rate - div_res = global_step / decay_steps - if staircase: - div_res = layers.floor(x=div_res) - return learning_rate * (decay_rate**div_res) + with init_on_cpu(): + # update learning_rate + div_res = global_step / decay_steps + if staircase: + div_res = layers.floor(x=div_res) + decayed_lr = learning_rate * (decay_rate**div_res) + + return decayed_lr def natural_exp_decay(learning_rate, @@ -88,10 +92,13 @@ def natural_exp_decay(learning_rate, if not isinstance(global_step, Variable): raise ValueError("global_step is required for natural_exp_decay.") - div_res = global_step / decay_steps - if staircase: - div_res = layers.floor(x=div_res) - return learning_rate * layers.exp(x=(-1 * decay_rate * div_res)) + with init_on_cpu(): + div_res = global_step / decay_steps + if staircase: + div_res = layers.floor(x=div_res) + decayed_lr = learning_rate * layers.exp(x=(-1 * decay_rate * div_res)) + + return decayed_lr def inverse_time_decay(learning_rate, @@ -121,11 +128,14 @@ def inverse_time_decay(learning_rate, if not isinstance(global_step, Variable): raise ValueError("global_step is required for inverse_time_decay.") - div_res = global_step / decay_steps - if staircase: - div_res = layers.floor(x=div_res) + with init_on_cpu(): + div_res = global_step / decay_steps + if staircase: + div_res = layers.floor(x=div_res) + + decayed_lr = learning_rate / (1 + decay_rate * div_res) - return learning_rate / (1 + decay_rate * div_res) + return decayed_lr def polynomial_decay(learning_rate, @@ -160,22 +170,27 @@ def polynomial_decay(learning_rate, if not isinstance(global_step, Variable): raise ValueError("global_step is required for inverse_time_decay.") - if cycle: - div_res = layers.ceil(x=(global_step / decay_steps)) - zero_var = layers.fill_constant(shape=[1], dtype='float32', value=0.0) - one_var = layers.fill_constant(shape=[1], dtype='float32', value=1.0) - - with layers.Switch() as switch: - with switch.case(layers.equal(x=global_step, y=zero_var)): - layers.assign(input=one_var, output=div_res) - decay_steps = decay_steps * div_res - else: - decay_steps_var = layers.fill_constant( - shape=[1], dtype='float32', value=float(decay_steps)) - global_step = layers.elementwise_min(x=global_step, y=decay_steps_var) - - return (learning_rate - end_learning_rate) * \ - ((1 - global_step / decay_steps) ** power) + end_learning_rate + with init_on_cpu(): + if cycle: + div_res = layers.ceil(x=(global_step / decay_steps)) + zero_var = layers.fill_constant( + shape=[1], dtype='float32', value=0.0) + one_var = layers.fill_constant( + shape=[1], dtype='float32', value=1.0) + + with layers.Switch() as switch: + with switch.case(layers.equal(x=global_step, y=zero_var)): + layers.assign(input=one_var, output=div_res) + decay_steps = decay_steps * div_res + else: + decay_steps_var = layers.fill_constant( + shape=[1], dtype='float32', value=float(decay_steps)) + global_step = layers.elementwise_min( + x=global_step, y=decay_steps_var) + + decayed_lr = (learning_rate - end_learning_rate) * \ + ((1 - global_step / decay_steps) ** power) + end_learning_rate + return decayed_lr def piecewise_decay(global_step, boundaries, values): @@ -200,24 +215,27 @@ def piecewise_decay(global_step, boundaries, values): if not isinstance(global_step, Variable): raise ValueError("global_step is required for piecewise_decay.") - lr = layers.create_global_var( - shape=[1], - value=0.0, - dtype='float32', - persistable=True, - name="learning_rate") - - with layers.Switch() as switch: - for i in range(len(boundaries)): - boundary_val = layers.fill_constant( - shape=[1], dtype='float32', value=float(boundaries[i])) - value_var = layers.fill_constant( - shape=[1], dtype='float32', value=float(values[i])) - with switch.case(layers.less_than(global_step, boundary_val)): - layers.assign(value_var, lr) - last_value_var = layers.fill_constant( - shape=[1], dtype='float32', value=float(values[len(values) - 1])) - with switch.default(): - layers.assign(last_value_var, lr) + with init_on_cpu(): + lr = layers.create_global_var( + shape=[1], + value=0.0, + dtype='float32', + persistable=True, + name="learning_rate") + + with layers.Switch() as switch: + for i in range(len(boundaries)): + boundary_val = layers.fill_constant( + shape=[1], dtype='float32', value=float(boundaries[i])) + value_var = layers.fill_constant( + shape=[1], dtype='float32', value=float(values[i])) + with switch.case(layers.less_than(global_step, boundary_val)): + layers.assign(value_var, lr) + last_value_var = layers.fill_constant( + shape=[1], + dtype='float32', + value=float(values[len(values) - 1])) + with switch.default(): + layers.assign(last_value_var, lr) return lr diff --git a/python/paddle/v2/fluid/tests/book/test_label_semantic_roles.py b/python/paddle/v2/fluid/tests/book/test_label_semantic_roles.py index 1491f7a8d54..f33e81186bd 100644 --- a/python/paddle/v2/fluid/tests/book/test_label_semantic_roles.py +++ b/python/paddle/v2/fluid/tests/book/test_label_semantic_roles.py @@ -18,6 +18,7 @@ import numpy as np import paddle.v2 as paddle import paddle.v2.dataset.conll05 as conll05 import paddle.v2.fluid as fluid +from paddle.v2.fluid.initializer import init_on_cpu import contextlib import time import unittest @@ -167,7 +168,16 @@ def train(use_cuda, save_dirname=None): # TODO(qiao) # check other optimizers and check why out will be NAN - sgd_optimizer = fluid.optimizer.SGD(learning_rate=0.0001) + global_step = fluid.layers.create_global_var( + shape=[1], value=0, dtype='float32', force_cpu=True, persistable=True) + sgd_optimizer = fluid.optimizer.SGD( + learning_rate=fluid.learning_rate_decay.exponential_decay( + learning_rate=0.0001, + global_step=global_step, + decay_steps=100000, + decay_rate=0.5, + staircase=True), + global_step=global_step) sgd_optimizer.minimize(avg_cost) # TODO(qiao) -- GitLab From a7e231faab8cbf77d97e838a72f26eb2c28f5c44 Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Fri, 9 Feb 2018 17:15:47 +0800 Subject: [PATCH 37/55] Delete "API" section from "Documentation" --- doc/index_cn.rst | 1 - doc/index_en.rst | 1 - 2 files changed, 2 deletions(-) diff --git a/doc/index_cn.rst b/doc/index_cn.rst index 63a78428583..0f645db6fc5 100644 --- a/doc/index_cn.rst +++ b/doc/index_cn.rst @@ -8,5 +8,4 @@ PaddlePaddle 文档 build_and_install/index_cn.rst howto/index_cn.rst dev/index_cn.rst - api/index_cn.rst faq/index_cn.rst diff --git a/doc/index_en.rst b/doc/index_en.rst index 5631381be08..166f56c28f4 100644 --- a/doc/index_en.rst +++ b/doc/index_en.rst @@ -8,4 +8,3 @@ PaddlePaddle Documentation build_and_install/index_en.rst howto/index_en.rst dev/index_en.rst - api/index_en.rst -- GitLab From 660f3e25e462b97ab8e98f514c02b28e4a59d7a7 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 9 Feb 2018 15:20:01 +0800 Subject: [PATCH 38/55] Fix CI --- paddle/framework/mixed_vector.h | 15 ++++++++++----- paddle/framework/mixed_vector_test.cu | 6 ++++-- paddle/operators/math/selected_rows_functor.cu | 4 +++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/paddle/framework/mixed_vector.h b/paddle/framework/mixed_vector.h index d388da4f2c7..f776f0317a2 100644 --- a/paddle/framework/mixed_vector.h +++ b/paddle/framework/mixed_vector.h @@ -277,11 +277,15 @@ class Vector { kDirty = 0x10 }; + void CopyToCPU() const { + // COPY GPU Data To CPU + Copy(cuda_vec_, platform::CPUPlace(), &cpu_vec_); + WaitPlace(cuda_vec_.place()); + } + void MutableCPU() { if (IsInCUDA() && IsDirty()) { - // COPY GPU Data To CPU - Copy(cuda_vec_, platform::CPUPlace(), &cpu_vec_); - WaitPlace(cuda_vec_.place()); + CopyToCPU(); } flag_ = kDirty | kDataInCPU; } @@ -311,8 +315,10 @@ class Vector { SetFlag(kDataInCUDA); } else if (!(place == cuda_vec_.place())) { framework::Tensor tmp; + WaitPlace(cuda_vec_.place()); Copy(cuda_vec_, boost::get(place), &tmp); WaitPlace(cuda_vec_.place()); + WaitPlace(place); cuda_vec_.ShareDataWith(tmp); } else { // Not Dirty && DataInCUDA && Device is same @@ -324,8 +330,7 @@ class Vector { void ImmutableCPU() const { if (IsDirty() && !IsInCPU()) { // If data has been changed in CUDA, or CPU has no data. - Copy(cuda_vec_, platform::CPUPlace(), &cpu_vec_); - WaitPlace(cuda_vec_.place()); + CopyToCPU(); UnsetFlag(kDirty); } SetFlag(kDataInCPU); diff --git a/paddle/framework/mixed_vector_test.cu b/paddle/framework/mixed_vector_test.cu index a037cc3b990..f02db8f612c 100644 --- a/paddle/framework/mixed_vector_test.cu +++ b/paddle/framework/mixed_vector_test.cu @@ -81,10 +81,12 @@ TEST(mixed_vector, MultiGPU) { } ASSERT_EQ(tmp.size(), 10); paddle::platform::CUDAPlace gpu0(0); + paddle::platform::SetDeviceId(0); multiply_10<<<1, 1, 0, GetCUDAStream(gpu0)>>>(tmp.MutableData(gpu0)); paddle::platform::CUDAPlace gpu1(1); - multiply_10<<<1, 1, 0, GetCUDAStream(gpu1)>>>(tmp.MutableData(gpu1)); - + auto* gpu1_ptr = tmp.MutableData(gpu1); + paddle::platform::SetDeviceId(1); + multiply_10<<<1, 1, 0, GetCUDAStream(gpu1)>>>(gpu1_ptr); for (int i = 0; i < 10; ++i) { ASSERT_EQ(tmp[i], i * 100); } diff --git a/paddle/operators/math/selected_rows_functor.cu b/paddle/operators/math/selected_rows_functor.cu index 5c3a53ae1ba..54a41a67d06 100644 --- a/paddle/operators/math/selected_rows_functor.cu +++ b/paddle/operators/math/selected_rows_functor.cu @@ -154,7 +154,9 @@ struct SelectedRowsAddTo { auto* in2_value = input2->mutable_value(); // concat rows - in2_rows.Extend(in1_rows.begin(), in1_rows.end()); + if (in1_rows.size()) { + in2_rows.Extend(in1_rows.begin(), in1_rows.end()); + } auto in1_place = input1.place(); PADDLE_ENFORCE(platform::is_gpu_place(in1_place)); -- GitLab From 725e64486acb0f448ae7365a6467ad37229bab2a Mon Sep 17 00:00:00 2001 From: emailweixu Date: Fri, 9 Feb 2018 01:45:14 -0800 Subject: [PATCH 39/55] cumsum operator (#8288) --- paddle/framework/grad_op_desc_maker.h | 5 + paddle/framework/op_registry.h | 2 +- paddle/operators/cum_op.h | 111 +++++++++++++++ paddle/operators/cumsum_op.cc | 82 +++++++++++ paddle/operators/cumsum_op.cu | 22 +++ python/paddle/v2/fluid/layers/ops.py | 2 + python/paddle/v2/fluid/tests/op_test.py | 3 +- .../paddle/v2/fluid/tests/test_cumsum_op.py | 127 ++++++++++++++++++ 8 files changed, 352 insertions(+), 2 deletions(-) create mode 100644 paddle/operators/cum_op.h create mode 100644 paddle/operators/cumsum_op.cc create mode 100644 paddle/operators/cumsum_op.cu create mode 100644 python/paddle/v2/fluid/tests/test_cumsum_op.py diff --git a/paddle/framework/grad_op_desc_maker.h b/paddle/framework/grad_op_desc_maker.h index 2082f8bb76f..f51753453be 100644 --- a/paddle/framework/grad_op_desc_maker.h +++ b/paddle/framework/grad_op_desc_maker.h @@ -122,6 +122,11 @@ class GradOpDescMakerBase { return it->second; } + template + inline const T& Attr(const std::string& name) const { + return boost::get(GetAttr(name)); + } + std::string ForwardOpType() const { return this->fwd_op_.Type(); } private: diff --git a/paddle/framework/op_registry.h b/paddle/framework/op_registry.h index 5de9ae559c4..6fb8532b2a8 100644 --- a/paddle/framework/op_registry.h +++ b/paddle/framework/op_registry.h @@ -143,7 +143,7 @@ class OpKernelRegistrar : public Registrar { /** * Macro to register Operator. When the input is duplicable, you should - * use REGISTER_OP_EX with deop_empty_grad=false instead. + * use REGISTER_OP_EX with drop_empty_grad=false instead. */ #define REGISTER_OP(op_type, op_class, op_maker_class, grad_op_type, \ grad_op_class) \ diff --git a/paddle/operators/cum_op.h b/paddle/operators/cum_op.h new file mode 100644 index 00000000000..e3813ac9036 --- /dev/null +++ b/paddle/operators/cum_op.h @@ -0,0 +1,111 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#pragma once +#include "paddle/framework/eigen.h" +#include "paddle/framework/op_registry.h" +#include "paddle/framework/operator.h" +#include "paddle/operators/detail/safe_ref.h" + +namespace paddle { +namespace operators { + +template +class CumKernel : public framework::OpKernel { + public: + using T = typename Functor::ELEMENT_TYPE; + + void Compute(const framework::ExecutionContext& context) const override { + auto& X = detail::Ref(context.Input("X"), + "Cannot get input tensor X, variable name = %s", + context.op().Input("X")); + + auto& Out = detail::Ref(context.Output("Out"), + "Cannot get output tensor Out, variable name = %s", + context.op().Output("Out")); + int axis = context.Attr("axis"); + bool exclusive = context.Attr("exclusive"); + bool reverse = context.Attr("reverse"); + auto x_dims = X.dims(); + if (axis == -1) { + axis = x_dims.size() - 1; + } + PADDLE_ENFORCE_LT( + axis, x_dims.size(), + "axis should be less than the dimensiotn of the input tensor"); + Out.mutable_data(context.GetPlace()); + + int pre = 1; + int post = 1; + int mid = x_dims[axis]; + for (int i = 0; i < axis; ++i) { + pre *= x_dims[i]; + } + for (int i = axis + 1; i < x_dims.size(); ++i) { + post *= x_dims[i]; + } + + auto x = framework::EigenVector::Flatten(X); + auto out = framework::EigenVector::Flatten(Out); + auto* place = + context.template device_context().eigen_device(); + + using IndexT = Eigen::DenseIndex; + if (pre == 1) { + if (post == 1) { + ComputeImp(*place, Eigen::DSizes(mid), x, out, + /* axis= */ 0, reverse, exclusive); + } else { + ComputeImp(*place, Eigen::DSizes(mid, post), x, out, + /* axis= */ 0, reverse, exclusive); + } + } else { + if (post == 1) { + ComputeImp(*place, Eigen::DSizes(pre, mid), x, out, + /* axis= */ 1, reverse, exclusive); + } else { + ComputeImp(*place, Eigen::DSizes(pre, mid, post), x, out, + /* axis= */ 1, reverse, exclusive); + } + } + } + + private: + template + void ComputeImp(Device d, const Dim& dims, X x, Out out, int axis, + bool reverse, bool exclusive) const { + if (!reverse) { + out.reshape(dims).device(d) = Functor()(x.reshape(dims), axis, exclusive); + } else { + std::array rev; + rev.fill(false); + rev[axis] = reverse; + out.reshape(dims).device(d) = + Functor()(x.reshape(dims).reverse(rev), axis, exclusive).reverse(rev); + } + } +}; + +template +struct CumsumFunctor { + using ELEMENT_TYPE = T; + template + const typename X::TensorScanSumOp operator()(X x, int axis, + bool exclusive) const { + return x.cumsum(axis, exclusive); + } +}; + +} // namespace operators +} // namespace paddle diff --git a/paddle/operators/cumsum_op.cc b/paddle/operators/cumsum_op.cc new file mode 100644 index 00000000000..4933cc923d4 --- /dev/null +++ b/paddle/operators/cumsum_op.cc @@ -0,0 +1,82 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include "paddle/operators/cum_op.h" + +namespace paddle { +namespace operators { + +class CumOp : public framework::OperatorWithKernel { + public: + using framework::OperatorWithKernel::OperatorWithKernel; + + void InferShape(framework::InferShapeContext *ctx) const override { + ctx->SetOutputDim("Out", ctx->GetInputDim("X")); + ctx->ShareLoD("X", /*->*/ "Out"); + } +}; + +class CumsumOpMaker : public framework::OpProtoAndCheckerMaker { + public: + CumsumOpMaker(OpProto *proto, OpAttrChecker *op_checker) + : framework::OpProtoAndCheckerMaker(proto, op_checker) { + AddInput("X", "Input of Cumsum operator"); + AddOutput("Out", "Output of Cumsum operator"); + AddAttr("axis", + "(int, default -1). The dimenstion to accumulate along. " + "-1 means the last dimenstion") + .SetDefault(-1) + .EqualGreaterThan(-1); + AddAttr("exclusive", + "bool, default false). Whether to perform exclusive cumsum") + .SetDefault(false); + AddAttr("reverse", + "bool, default false). If true, the cumsum is performed in " + "the reversed direction") + .SetDefault(false); + AddComment(R"DOC( +The cumulative sum of the elements along a given axis. +By default, the first element of the result is the same of the first element of +the input. If exlusive is true, the first element of the result is 0. +)DOC"); + } +}; + +class CumsumGradMaker : public framework::SingleGradOpDescMaker { + public: + using framework::SingleGradOpDescMaker::SingleGradOpDescMaker; + + protected: + std::unique_ptr Apply() const override { + auto *grad_op = new framework::OpDesc(); + grad_op->SetType("cumsum"); + grad_op->SetInput("X", OutputGrad("Out")); + grad_op->SetOutput("Out", InputGrad("X")); + grad_op->SetAttr("axis", Attr("axis")); + grad_op->SetAttr("reverse", !Attr("reverse")); + grad_op->SetAttr("exclusive", Attr("exclusive")); + return std::unique_ptr(grad_op); + } +}; + +} // namespace operators +} // namespace paddle + +namespace ops = paddle::operators; +using CPU = paddle::platform::CPUDeviceContext; + +REGISTER_OPERATOR(cumsum, ops::CumOp, ops::CumsumOpMaker, ops::CumsumGradMaker); +REGISTER_OP_CPU_KERNEL(cumsum, ops::CumKernel>, + ops::CumKernel>, + ops::CumKernel>) diff --git a/paddle/operators/cumsum_op.cu b/paddle/operators/cumsum_op.cu new file mode 100644 index 00000000000..90661c4269a --- /dev/null +++ b/paddle/operators/cumsum_op.cu @@ -0,0 +1,22 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include "paddle/operators/cum_op.h" + +namespace ops = paddle::operators; +using CUDA = paddle::platform::CUDADeviceContext; + +REGISTER_OP_CUDA_KERNEL(cumsum, ops::CumKernel>, + ops::CumKernel>, + ops::CumKernel>) diff --git a/python/paddle/v2/fluid/layers/ops.py b/python/paddle/v2/fluid/layers/ops.py index 38dea2892fc..bb3f71abbb0 100644 --- a/python/paddle/v2/fluid/layers/ops.py +++ b/python/paddle/v2/fluid/layers/ops.py @@ -65,6 +65,8 @@ __all__ = [ 'logical_or', 'logical_xor', 'logical_not', + 'uniform_random', + 'cumsum', ] + __activations__ for _OP in set(__all__): diff --git a/python/paddle/v2/fluid/tests/op_test.py b/python/paddle/v2/fluid/tests/op_test.py index 3f6d7070c29..f8475813c0c 100644 --- a/python/paddle/v2/fluid/tests/op_test.py +++ b/python/paddle/v2/fluid/tests/op_test.py @@ -326,7 +326,8 @@ class OpTest(unittest.TestCase): self.assertTrue( np.allclose( actual_t, expect_t, atol=atol), - "Output (" + out_name + ") has diff at " + str(place)) + "Output (" + out_name + ") has diff at " + str(place) + + str(actual_t) + str(expect_t)) if isinstance(expect, tuple): self.assertListEqual(actual.lod(), expect[1], "Output (" + out_name + diff --git a/python/paddle/v2/fluid/tests/test_cumsum_op.py b/python/paddle/v2/fluid/tests/test_cumsum_op.py new file mode 100644 index 00000000000..e45ef457306 --- /dev/null +++ b/python/paddle/v2/fluid/tests/test_cumsum_op.py @@ -0,0 +1,127 @@ +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest +import numpy as np +from op_test import OpTest + + +class TestSumOp1(OpTest): + def setUp(self): + self.op_type = "cumsum" + self.attrs = {'axis': 2} + self.inputs = {'X': np.random.random((5, 6, 10)).astype("float64")} + self.outputs = {'Out': self.inputs['X'].cumsum(axis=2)} + + def test_check_output(self): + self.check_output() + + def test_check_grad(self): + self.check_grad(['X'], 'Out') + + +class TestSumOp2(OpTest): + def setUp(self): + self.op_type = "cumsum" + self.attrs = {'axis': -1, 'reverse': True} + self.inputs = {'X': np.random.random((5, 6, 10)).astype("float64")} + self.outputs = { + 'Out': np.flip( + np.flip( + self.inputs['X'], axis=2).cumsum(axis=2), axis=2) + } + + def test_check_output(self): + self.check_output() + + def test_check_grad(self): + self.check_grad(['X'], 'Out') + + +class TestSumOp3(OpTest): + def setUp(self): + self.op_type = "cumsum" + self.attrs = {'axis': 1} + self.inputs = {'X': np.random.random((5, 6, 10)).astype("float64")} + self.outputs = {'Out': self.inputs['X'].cumsum(axis=1)} + + def test_check_output(self): + self.check_output() + + def test_check_grad(self): + self.check_grad(['X'], 'Out') + + +class TestSumOp4(OpTest): + def setUp(self): + self.op_type = "cumsum" + self.attrs = {'axis': 0} + self.inputs = {'X': np.random.random((5, 6, 10)).astype("float64")} + self.outputs = {'Out': self.inputs['X'].cumsum(axis=0)} + + def test_check_output(self): + self.check_output() + + def test_check_grad(self): + self.check_grad(['X'], 'Out') + + +class TestSumOp5(OpTest): + def setUp(self): + self.op_type = "cumsum" + self.inputs = {'X': np.random.random((5, 6)).astype("float64")} + self.outputs = {'Out': self.inputs['X'].cumsum(axis=1)} + + def test_check_output(self): + self.check_output() + + def test_check_grad(self): + self.check_grad(['X'], 'Out') + + +class TestSumOp7(OpTest): + def setUp(self): + self.op_type = "cumsum" + self.inputs = {'X': np.random.random((6)).astype("float64")} + self.outputs = {'Out': self.inputs['X'].cumsum(axis=0)} + + def test_check_output(self): + self.check_output() + + def test_check_grad(self): + self.check_grad(['X'], 'Out') + + +class TestSumOp8(OpTest): + def setUp(self): + self.op_type = "cumsum" + self.attrs = {'axis': 2, "exclusive": True} + a = np.random.random((5, 6, 3)).astype("float64") + self.inputs = {'X': a} + self.outputs = { + 'Out': np.concatenate( + (np.zeros( + (5, 6, 1), dtype=np.float64), a[:, :, :-1].cumsum(axis=2)), + axis=2) + } + + def test_check_output(self): + self.check_output() + + def test_check_grad(self): + self.check_grad(['X'], 'Out') + + +if __name__ == '__main__': + unittest.main() -- GitLab From 720994b40007c3d3fc5691d6a2f0e3257e31f88f Mon Sep 17 00:00:00 2001 From: kexinzhao Date: Fri, 9 Feb 2018 02:06:33 -0800 Subject: [PATCH 40/55] Add inference example and unit-test for fit-a-line book chapter (#8208) * initial commit * minor fix * remove redundency * address comments --- paddle/inference/tests/book/CMakeLists.txt | 1 + .../tests/book/test_inference_fit_a_line.cc | 57 +++++++++++++++++++ .../v2/fluid/tests/book/test_fit_a_line.py | 48 ++++++++++++++-- 3 files changed, 100 insertions(+), 6 deletions(-) create mode 100644 paddle/inference/tests/book/test_inference_fit_a_line.cc diff --git a/paddle/inference/tests/book/CMakeLists.txt b/paddle/inference/tests/book/CMakeLists.txt index 5c866eb1e2e..5d065e53b2d 100644 --- a/paddle/inference/tests/book/CMakeLists.txt +++ b/paddle/inference/tests/book/CMakeLists.txt @@ -24,6 +24,7 @@ function(inference_test TARGET_NAME) endforeach() endfunction(inference_test) +inference_test(fit_a_line) inference_test(recognize_digits ARGS mlp) inference_test(image_classification ARGS vgg resnet) inference_test(label_semantic_roles) diff --git a/paddle/inference/tests/book/test_inference_fit_a_line.cc b/paddle/inference/tests/book/test_inference_fit_a_line.cc new file mode 100644 index 00000000000..201a2801cd6 --- /dev/null +++ b/paddle/inference/tests/book/test_inference_fit_a_line.cc @@ -0,0 +1,57 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include +#include "gflags/gflags.h" +#include "test_helper.h" + +DEFINE_string(dirname, "", "Directory of the inference model."); + +TEST(inference, fit_a_line) { + if (FLAGS_dirname.empty()) { + LOG(FATAL) << "Usage: ./example --dirname=path/to/your/model"; + } + + LOG(INFO) << "FLAGS_dirname: " << FLAGS_dirname << std::endl; + std::string dirname = FLAGS_dirname; + + // 0. Call `paddle::framework::InitDevices()` initialize all the devices + // In unittests, this is done in paddle/testing/paddle_gtest_main.cc + + paddle::framework::LoDTensor input; + // The second dim of the input tensor should be 13 + // The input data should be >= 0 + int64_t batch_size = 10; + SetupTensor( + input, {batch_size, 13}, static_cast(0), static_cast(10)); + std::vector cpu_feeds; + cpu_feeds.push_back(&input); + + paddle::framework::LoDTensor output1; + std::vector cpu_fetchs1; + cpu_fetchs1.push_back(&output1); + + // Run inference on CPU + TestInference(dirname, cpu_feeds, cpu_fetchs1); + LOG(INFO) << output1.dims(); + +#ifdef PADDLE_WITH_CUDA + paddle::framework::LoDTensor output2; + std::vector cpu_fetchs2; + cpu_fetchs2.push_back(&output2); + + // Run inference on CUDA GPU + TestInference(dirname, cpu_feeds, cpu_fetchs2); + LOG(INFO) << output2.dims(); + + CheckError(output1, output2); +#endif +} diff --git a/python/paddle/v2/fluid/tests/book/test_fit_a_line.py b/python/paddle/v2/fluid/tests/book/test_fit_a_line.py index 06860a2a465..b3332b4810b 100644 --- a/python/paddle/v2/fluid/tests/book/test_fit_a_line.py +++ b/python/paddle/v2/fluid/tests/book/test_fit_a_line.py @@ -15,15 +15,13 @@ import paddle.v2 as paddle import paddle.v2.fluid as fluid import contextlib +import numpy import unittest import math import sys -def main(use_cuda): - if use_cuda and not fluid.core.is_compiled_with_cuda(): - return - +def train(use_cuda, save_dirname): x = fluid.layers.data(name='x', shape=[13], dtype='float32') y_predict = fluid.layers.fc(input=x, size=1, act=None) @@ -51,14 +49,15 @@ def main(use_cuda): PASS_NUM = 100 for pass_id in range(PASS_NUM): - fluid.io.save_persistables(exe, "./fit_a_line.model/") - fluid.io.load_persistables(exe, "./fit_a_line.model/") for data in train_reader(): avg_loss_value, = exe.run(fluid.default_main_program(), feed=feeder.feed(data), fetch_list=[avg_cost]) print(avg_loss_value) if avg_loss_value[0] < 10.0: + if save_dirname is not None: + fluid.io.save_inference_model(save_dirname, ['x'], + [y_predict], exe) return if math.isnan(float(avg_loss_value)): sys.exit("got NaN loss, training failed.") @@ -66,6 +65,43 @@ def main(use_cuda): avg_loss_value[0])) +def infer(use_cuda, save_dirname=None): + if save_dirname is None: + return + + place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace() + exe = fluid.Executor(place) + + # Use fluid.io.load_inference_model to obtain the inference program desc, + # the feed_target_names (the names of variables that will be feeded + # data using feed operators), and the fetch_targets (variables that + # we want to obtain data from using fetch operators). + [inference_program, feed_target_names, + fetch_targets] = fluid.io.load_inference_model(save_dirname, exe) + + # The input's dimension should be 2-D and the second dim is 13 + # The input data should be >= 0 + batch_size = 10 + tensor_x = numpy.random.uniform(0, 10, [batch_size, 13]).astype("float32") + assert feed_target_names[0] == 'x' + results = exe.run(inference_program, + feed={feed_target_names[0]: tensor_x}, + fetch_list=fetch_targets) + print("infer shape: ", results[0].shape) + print("infer results: ", results[0]) + + +def main(use_cuda): + if use_cuda and not fluid.core.is_compiled_with_cuda(): + return + + # Directory for saving the trained model + save_dirname = "fit_a_line.inference.model" + + train(use_cuda, save_dirname) + infer(use_cuda, save_dirname) + + class TestFitALine(unittest.TestCase): def test_cpu(self): with self.program_scope_guard(): -- GitLab From 159b7722f496c83cbed44e002914062cf45f6396 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Sat, 10 Feb 2018 00:47:19 +0800 Subject: [PATCH 41/55] Delete "Operators" in API tree (#8324) --- paddle/pybind/CMakeLists.txt | 4 - paddle/pybind/print_operators_doc.cc | 148 --------------------------- paddle/scripts/docker/build.sh | 2 - paddle/scripts/travis/build_doc.sh | 2 - 4 files changed, 156 deletions(-) delete mode 100644 paddle/pybind/print_operators_doc.cc diff --git a/paddle/pybind/CMakeLists.txt b/paddle/pybind/CMakeLists.txt index de53fea0dd6..d62f3403089 100644 --- a/paddle/pybind/CMakeLists.txt +++ b/paddle/pybind/CMakeLists.txt @@ -7,7 +7,3 @@ if(WITH_PYTHON) target_link_libraries(paddle_pybind rt) endif(NOT APPLE AND NOT ANDROID) endif(WITH_PYTHON) - -if(WITH_DOC) - cc_binary(print_operators_doc SRCS print_operators_doc.cc DEPS ${GLOB_OP_LIB}) -endif(WITH_DOC) diff --git a/paddle/pybind/print_operators_doc.cc b/paddle/pybind/print_operators_doc.cc deleted file mode 100644 index b55ddee1761..00000000000 --- a/paddle/pybind/print_operators_doc.cc +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include -#include // std::stringstream -#include - -#include "paddle/framework/op_info.h" -#include "paddle/framework/op_registry.h" -#include "paddle/pybind/pybind.h" - -std::string Escape(const std::string& s) { - std::string r; - for (size_t i = 0; i < s.size(); i++) { - switch (s[i]) { - case '\"': - r += "\\\""; - break; - case '\\': - r += "\\\\"; - break; - case '\n': - r += "\\n"; - break; - case '\t': - r += "\\t"; - case '\r': - break; - default: - r += s[i]; - break; - } - } - return r; -} - -std::string AttrType(paddle::framework::proto::AttrType at) { - switch (at) { - case paddle::framework::proto::INT: - return "int"; - case paddle::framework::proto::FLOAT: - return "float"; - case paddle::framework::proto::STRING: - return "string"; - case paddle::framework::proto::BOOLEAN: - return "bool"; - case paddle::framework::proto::INTS: - return "int array"; - case paddle::framework::proto::FLOATS: - return "float array"; - case paddle::framework::proto::STRINGS: - return "string array"; - case paddle::framework::proto::BOOLEANS: - return "bool array"; - case paddle::framework::proto::BLOCK: - return "block id"; - case paddle::framework::proto::LONG: - return "long"; - } - return "UNKNOWN"; // not possible -} - -void PrintVar(const paddle::framework::proto::OpProto::Var& v, - std::stringstream& ss) { - ss << " { " - << "\n" - << " \"name\" : \"" << Escape(v.name()) << "\",\n" - << " \"comment\" : \"" << Escape(v.comment()) << "\",\n" - << " \"duplicable\" : " << v.duplicable() << ",\n" - << " \"intermediate\" : " << v.intermediate() << "\n" - << " },"; -} - -void PrintAttr(const paddle::framework::proto::OpProto::Attr& a, - std::stringstream& ss) { - ss << " { " - << "\n" - << " \"name\" : \"" << Escape(a.name()) << "\",\n" - << " \"type\" : \"" << AttrType(a.type()) << "\",\n" - << " \"comment\" : \"" << Escape(a.comment()) << "\",\n" - << " \"generated\" : " << a.generated() << "\n" - << " },"; -} - -void PrintOpProto(const std::string& type, - const paddle::framework::OpInfo& opinfo, - std::stringstream& ss) { - std::cerr << "Processing " << type << "\n"; - - const paddle::framework::proto::OpProto* p = opinfo.proto_; - if (p == nullptr) { - return; // It is possible that an operator doesn't have OpProto. - } - - ss << "{\n" - << " \"type\" : \"" << Escape(p->type()) << "\",\n" - << " \"comment\" : \"" << Escape(p->comment()) << "\",\n"; - - ss << " \"inputs\" : [ " - << "\n"; - for (int i = 0; i < p->inputs_size(); i++) { - PrintVar(p->inputs(i), ss); - } - ss.seekp(-1, ss.cur); // remove the trailing comma - ss << " ], " - << "\n"; - - ss << " \"outputs\" : [ " - << "\n"; - for (int i = 0; i < p->outputs_size(); i++) { - PrintVar(p->outputs(i), ss); - } - ss.seekp(-1, ss.cur); // remove the trailing comma - ss << " ], " - << "\n"; - - ss << " \"attrs\" : [ " - << "\n"; - for (int i = 0; i < p->attrs_size(); i++) { - PrintAttr(p->attrs(i), ss); - } - ss.seekp(-1, ss.cur); // remove the trailing comma - ss << " ] " - << "\n"; - - ss << "},"; -} - -int main() { - std::stringstream ss; - ss << "[\n"; - for (auto& iter : paddle::framework::OpInfoMap::Instance().map()) { - PrintOpProto(iter.first, iter.second, ss); - } - ss.seekp(-1, ss.cur); // remove the trailing comma - ss << "]\n"; - std::cout << ss.str(); -} diff --git a/paddle/scripts/docker/build.sh b/paddle/scripts/docker/build.sh index ba496db5f83..2f8dd48efe1 100644 --- a/paddle/scripts/docker/build.sh +++ b/paddle/scripts/docker/build.sh @@ -118,8 +118,6 @@ EOF make -j `nproc` gen_proto_py make -j `nproc` paddle_python make -j `nproc` paddle_docs paddle_docs_cn paddle_api_docs - make -j `nproc` print_operators_doc - paddle/pybind/print_operators_doc > doc/en/html/operators.json popd fi diff --git a/paddle/scripts/travis/build_doc.sh b/paddle/scripts/travis/build_doc.sh index 4af4ac4f5e4..486c094a6ac 100755 --- a/paddle/scripts/travis/build_doc.sh +++ b/paddle/scripts/travis/build_doc.sh @@ -10,8 +10,6 @@ cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_MKL=OFF -DWITH_DOC=ON make -j `nproc` gen_proto_py make -j `nproc` paddle_python make -j `nproc` paddle_docs paddle_docs_cn paddle_api_docs -make -j `nproc` print_operators_doc -paddle/pybind/print_operators_doc > doc/en/html/operators.json # check websites for broken links linkchecker doc/en/html/index.html -- GitLab From 4b62fcd07db826442e291633c5a60d9e2a698b80 Mon Sep 17 00:00:00 2001 From: kexinzhao Date: Fri, 9 Feb 2018 11:32:05 -0800 Subject: [PATCH 42/55] Add Inference example and unit test for understand sentiment (#8251) * initial commit * fix bug * end of file fix * address comments --- paddle/inference/tests/book/CMakeLists.txt | 1 + .../test_inference_understand_sentiment.cc | 60 +++++++++++++++++ .../tests/book/test_understand_sentiment.py | 64 +++++++++++++++++-- 3 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 paddle/inference/tests/book/test_inference_understand_sentiment.cc diff --git a/paddle/inference/tests/book/CMakeLists.txt b/paddle/inference/tests/book/CMakeLists.txt index 5d065e53b2d..ca3c056b097 100644 --- a/paddle/inference/tests/book/CMakeLists.txt +++ b/paddle/inference/tests/book/CMakeLists.txt @@ -30,3 +30,4 @@ inference_test(image_classification ARGS vgg resnet) inference_test(label_semantic_roles) inference_test(rnn_encoder_decoder) inference_test(recommender_system) +inference_test(understand_sentiment) diff --git a/paddle/inference/tests/book/test_inference_understand_sentiment.cc b/paddle/inference/tests/book/test_inference_understand_sentiment.cc new file mode 100644 index 00000000000..1afb6444465 --- /dev/null +++ b/paddle/inference/tests/book/test_inference_understand_sentiment.cc @@ -0,0 +1,60 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include +#include "gflags/gflags.h" +#include "test_helper.h" + +DEFINE_string(dirname, "", "Directory of the inference model."); + +TEST(inference, understand_sentiment) { + if (FLAGS_dirname.empty()) { + LOG(FATAL) << "Usage: ./example --dirname=path/to/your/model"; + } + + LOG(INFO) << "FLAGS_dirname: " << FLAGS_dirname << std::endl; + std::string dirname = FLAGS_dirname; + + // 0. Call `paddle::framework::InitDevices()` initialize all the devices + // In unittests, this is done in paddle/testing/paddle_gtest_main.cc + + paddle::framework::LoDTensor words; + paddle::framework::LoD lod{{0, 4, 10}}; + SetupLoDTensor(words, lod, static_cast(0), static_cast(10)); + + std::vector cpu_feeds; + cpu_feeds.push_back(&words); + + paddle::framework::LoDTensor output1; + std::vector cpu_fetchs1; + cpu_fetchs1.push_back(&output1); + + // Run inference on CPU + TestInference(dirname, cpu_feeds, cpu_fetchs1); + LOG(INFO) << output1.lod(); + LOG(INFO) << output1.dims(); + +#ifdef PADDLE_WITH_CUDA + paddle::framework::LoDTensor output2; + std::vector cpu_fetchs2; + cpu_fetchs2.push_back(&output2); + + // Run inference on CUDA GPU + TestInference(dirname, cpu_feeds, cpu_fetchs2); + LOG(INFO) << output2.lod(); + LOG(INFO) << output2.dims(); + + CheckError(output1, output2); +#endif +} diff --git a/python/paddle/v2/fluid/tests/book/test_understand_sentiment.py b/python/paddle/v2/fluid/tests/book/test_understand_sentiment.py index 9c5cb667aed..6e0206d41db 100644 --- a/python/paddle/v2/fluid/tests/book/test_understand_sentiment.py +++ b/python/paddle/v2/fluid/tests/book/test_understand_sentiment.py @@ -17,6 +17,7 @@ import paddle.v2.fluid as fluid import paddle.v2 as paddle import contextlib import math +import numpy as np import sys @@ -43,7 +44,7 @@ def convolution_net(data, label, input_dim, class_dim=2, emb_dim=32, adam_optimizer = fluid.optimizer.Adam(learning_rate=0.002) adam_optimizer.minimize(avg_cost) accuracy = fluid.layers.accuracy(input=prediction, label=label) - return avg_cost, accuracy + return avg_cost, accuracy, prediction def stacked_lstm_net(data, @@ -81,13 +82,18 @@ def stacked_lstm_net(data, adam_optimizer = fluid.optimizer.Adam(learning_rate=0.002) adam_optimizer.minimize(avg_cost) accuracy = fluid.layers.accuracy(input=prediction, label=label) - return avg_cost, accuracy + return avg_cost, accuracy, prediction -def main(word_dict, net_method, use_cuda): - if use_cuda and not fluid.core.is_compiled_with_cuda(): - return +def create_random_lodtensor(lod, place, low, high): + data = np.random.random_integers(low, high, [lod[-1], 1]).astype("int64") + res = fluid.LoDTensor() + res.set(data, place) + res.set_lod([lod]) + return res + +def train(word_dict, net_method, use_cuda, save_dirname=None): BATCH_SIZE = 128 PASS_NUM = 5 dict_dim = len(word_dict) @@ -96,7 +102,7 @@ def main(word_dict, net_method, use_cuda): data = fluid.layers.data( name="words", shape=[1], dtype="int64", lod_level=1) label = fluid.layers.data(name="label", shape=[1], dtype="int64") - cost, acc_out = net_method( + cost, acc_out, prediction = net_method( data, label, input_dim=dict_dim, class_dim=class_dim) train_data = paddle.batch( @@ -116,6 +122,9 @@ def main(word_dict, net_method, use_cuda): fetch_list=[cost, acc_out]) print("cost=" + str(cost_val) + " acc=" + str(acc_val)) if cost_val < 0.4 and acc_val > 0.8: + if save_dirname is not None: + fluid.io.save_inference_model(save_dirname, ["words"], + prediction, exe) return if math.isnan(float(cost_val)): sys.exit("got NaN loss, training failed.") @@ -123,6 +132,49 @@ def main(word_dict, net_method, use_cuda): net_method.__name__)) +def infer(use_cuda, save_dirname=None): + if save_dirname is None: + return + + place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace() + exe = fluid.Executor(place) + + # Use fluid.io.load_inference_model to obtain the inference program desc, + # the feed_target_names (the names of variables that will be feeded + # data using feed operators), and the fetch_targets (variables that + # we want to obtain data from using fetch operators). + [inference_program, feed_target_names, + fetch_targets] = fluid.io.load_inference_model(save_dirname, exe) + + lod = [0, 4, 10] + word_dict = paddle.dataset.imdb.word_dict() + tensor_words = create_random_lodtensor( + lod, place, low=0, high=len(word_dict) - 1) + + # Construct feed as a dictionary of {feed_target_name: feed_target_data} + # and results will contain a list of data corresponding to fetch_targets. + assert feed_target_names[0] == "words" + results = exe.run(inference_program, + feed={feed_target_names[0]: tensor_words}, + fetch_list=fetch_targets, + return_numpy=False) + print(results[0].lod()) + np_data = np.array(results[0]) + print("Inference Shape: ", np_data.shape) + print("Inference results: ", np_data) + + +def main(word_dict, net_method, use_cuda): + if use_cuda and not fluid.core.is_compiled_with_cuda(): + return + + # Directory for saving the trained model + save_dirname = "understand_sentiment.inference.model" + + train(word_dict, net_method, use_cuda, save_dirname) + infer(use_cuda, save_dirname) + + class TestUnderstandSentiment(unittest.TestCase): @classmethod def setUpClass(cls): -- GitLab From 1961470fff6df93383d1f4d7a990680ef480454c Mon Sep 17 00:00:00 2001 From: Siddharth Goyal Date: Fri, 9 Feb 2018 14:30:42 -0800 Subject: [PATCH 43/55] Add inference example and unit-test for word2vec chapter (#8206) * Add unit-test and example * Fix type error * Fix unit test cases * Fix init error for cudaplace * Change unit-test options --- paddle/inference/tests/book/CMakeLists.txt | 5 +- paddle/inference/tests/book/test_helper.h | 5 +- .../tests/book/test_inference_word2vec.cc | 68 ++++++++++++++++ .../v2/fluid/tests/book/test_word2vec.py | 81 +++++++++++++++++-- 4 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 paddle/inference/tests/book/test_inference_word2vec.cc diff --git a/paddle/inference/tests/book/CMakeLists.txt b/paddle/inference/tests/book/CMakeLists.txt index ca3c056b097..9fe76afb582 100644 --- a/paddle/inference/tests/book/CMakeLists.txt +++ b/paddle/inference/tests/book/CMakeLists.txt @@ -25,9 +25,10 @@ function(inference_test TARGET_NAME) endfunction(inference_test) inference_test(fit_a_line) -inference_test(recognize_digits ARGS mlp) inference_test(image_classification ARGS vgg resnet) inference_test(label_semantic_roles) -inference_test(rnn_encoder_decoder) +inference_test(recognize_digits ARGS mlp) inference_test(recommender_system) +inference_test(rnn_encoder_decoder) inference_test(understand_sentiment) +inference_test(word2vec) diff --git a/paddle/inference/tests/book/test_helper.h b/paddle/inference/tests/book/test_helper.h index 22ce903c725..02104306e71 100644 --- a/paddle/inference/tests/book/test_helper.h +++ b/paddle/inference/tests/book/test_helper.h @@ -91,7 +91,7 @@ template void TestInference(const std::string& dirname, const std::vector& cpu_feeds, std::vector& cpu_fetchs) { - // 1. Define place, executor, scope and inference_program + // 1. Define place, executor, scope auto place = Place(); auto executor = paddle::framework::Executor(place); auto* scope = new paddle::framework::Scope(); @@ -101,7 +101,8 @@ void TestInference(const std::string& dirname, if (IsCombined) { // All parameters are saved in a single file. // Hard-coding the file names of program and parameters in unittest. - // Users are free to specify different filename. + // Users are free to specify different filename + // (provided: the filenames are changed in the python api as well: io.py) std::string prog_filename = "__model_combined__"; std::string param_filename = "__params_combined__"; inference_program = paddle::inference::Load(executor, diff --git a/paddle/inference/tests/book/test_inference_word2vec.cc b/paddle/inference/tests/book/test_inference_word2vec.cc new file mode 100644 index 00000000000..ca0c040ff62 --- /dev/null +++ b/paddle/inference/tests/book/test_inference_word2vec.cc @@ -0,0 +1,68 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include +#include "gflags/gflags.h" +#include "test_helper.h" + +DEFINE_string(dirname, "", "Directory of the inference model."); + +TEST(inference, word2vec) { + if (FLAGS_dirname.empty()) { + LOG(FATAL) << "Usage: ./example --dirname=path/to/your/model"; + } + + LOG(INFO) << "FLAGS_dirname: " << FLAGS_dirname << std::endl; + std::string dirname = FLAGS_dirname; + + // 0. Call `paddle::framework::InitDevices()` initialize all the devices + // In unittests, this is done in paddle/testing/paddle_gtest_main.cc + + paddle::framework::LoDTensor first_word, second_word, third_word, fourth_word; + paddle::framework::LoD lod{{0, 1}}; + int64_t dict_size = 2072; // Hard-coding the size of dictionary + + SetupLoDTensor(first_word, lod, static_cast(0), dict_size); + SetupLoDTensor(second_word, lod, static_cast(0), dict_size); + SetupLoDTensor(third_word, lod, static_cast(0), dict_size); + SetupLoDTensor(fourth_word, lod, static_cast(0), dict_size); + + std::vector cpu_feeds; + cpu_feeds.push_back(&first_word); + cpu_feeds.push_back(&second_word); + cpu_feeds.push_back(&third_word); + cpu_feeds.push_back(&fourth_word); + + paddle::framework::LoDTensor output1; + std::vector cpu_fetchs1; + cpu_fetchs1.push_back(&output1); + + // Run inference on CPU + TestInference(dirname, cpu_feeds, cpu_fetchs1); + LOG(INFO) << output1.lod(); + LOG(INFO) << output1.dims(); + +#ifdef PADDLE_WITH_CUDA + paddle::framework::LoDTensor output2; + std::vector cpu_fetchs2; + cpu_fetchs2.push_back(&output2); + + // Run inference on CUDA GPU + TestInference(dirname, cpu_feeds, cpu_fetchs2); + LOG(INFO) << output2.lod(); + LOG(INFO) << output2.dims(); + + CheckError(output1, output2); +#endif +} diff --git a/python/paddle/v2/fluid/tests/book/test_word2vec.py b/python/paddle/v2/fluid/tests/book/test_word2vec.py index f013d7f1551..69bfbcee69a 100644 --- a/python/paddle/v2/fluid/tests/book/test_word2vec.py +++ b/python/paddle/v2/fluid/tests/book/test_word2vec.py @@ -1,6 +1,5 @@ # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. -# -# Licensed under the Apache License, Version 2.0 (the "License"); +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # @@ -16,14 +15,67 @@ import paddle.v2 as paddle import paddle.v2.fluid as fluid import unittest import os +import numpy as np import math import sys -def main(use_cuda, is_sparse, parallel): - if use_cuda and not fluid.core.is_compiled_with_cuda(): +def create_random_lodtensor(lod, place, low, high): + data = np.random.random_integers(low, high, [lod[-1], 1]).astype("int64") + res = fluid.LoDTensor() + res.set(data, place) + res.set_lod([lod]) + return res + + +def infer(use_cuda, save_dirname=None): + if save_dirname is None: return + place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace() + exe = fluid.Executor(place) + + # Use fluid.io.load_inference_model to obtain the inference program desc, + # the feed_target_names (the names of variables that will be feeded + # data using feed operators), and the fetch_targets (variables that + # we want to obtain data from using fetch operators). + [inference_program, feed_target_names, + fetch_targets] = fluid.io.load_inference_model(save_dirname, exe) + + word_dict = paddle.dataset.imikolov.build_dict() + dict_size = len(word_dict) - 1 + + # Setup input, by creating 4 words, and setting up lod required for + # lookup_table_op + lod = [0, 1] + first_word = create_random_lodtensor(lod, place, low=0, high=dict_size) + second_word = create_random_lodtensor(lod, place, low=0, high=dict_size) + third_word = create_random_lodtensor(lod, place, low=0, high=dict_size) + fourth_word = create_random_lodtensor(lod, place, low=0, high=dict_size) + + assert feed_target_names[0] == 'firstw' + assert feed_target_names[1] == 'secondw' + assert feed_target_names[2] == 'thirdw' + assert feed_target_names[3] == 'forthw' + + # Construct feed as a dictionary of {feed_target_name: feed_target_data} + # and results will contain a list of data corresponding to fetch_targets. + results = exe.run(inference_program, + feed={ + feed_target_names[0]: first_word, + feed_target_names[1]: second_word, + feed_target_names[2]: third_word, + feed_target_names[3]: fourth_word + }, + fetch_list=fetch_targets, + return_numpy=False) + print(results[0].lod()) + np_data = np.array(results[0]) + print("Inference Shape: ", np_data.shape) + print("Inference results: ", np_data) + + +def train(use_cuda, is_sparse, parallel, save_dirname): PASS_NUM = 100 EMBED_SIZE = 32 HIDDEN_SIZE = 256 @@ -67,7 +119,7 @@ def main(use_cuda, is_sparse, parallel): act='softmax') cost = fluid.layers.cross_entropy(input=predict_word, label=words[4]) avg_cost = fluid.layers.mean(x=cost) - return avg_cost + return avg_cost, predict_word word_dict = paddle.dataset.imikolov.build_dict() dict_size = len(word_dict) @@ -79,13 +131,13 @@ def main(use_cuda, is_sparse, parallel): next_word = fluid.layers.data(name='nextw', shape=[1], dtype='int64') if not parallel: - avg_cost = __network__( + avg_cost, predict_word = __network__( [first_word, second_word, third_word, forth_word, next_word]) else: places = fluid.layers.get_places() pd = fluid.layers.ParallelDo(places) with pd.do(): - avg_cost = __network__( + avg_cost, predict_word = __network__( map(pd.read_input, [ first_word, second_word, third_word, forth_word, next_word ])) @@ -113,6 +165,10 @@ def main(use_cuda, is_sparse, parallel): feed=feeder.feed(data), fetch_list=[avg_cost]) if avg_cost_np[0] < 5.0: + if save_dirname is not None: + fluid.io.save_inference_model(save_dirname, [ + 'firstw', 'secondw', 'thirdw', 'forthw' + ], [predict_word], exe) return if math.isnan(float(avg_cost_np[0])): sys.exit("got NaN loss, training failed.") @@ -120,6 +176,14 @@ def main(use_cuda, is_sparse, parallel): raise AssertionError("Cost is too large {0:2.2}".format(avg_cost_np[0])) +def main(use_cuda, is_sparse, parallel): + if use_cuda and not fluid.core.is_compiled_with_cuda(): + return + save_dirname = "word2vec.inference.model" + train(use_cuda, is_sparse, parallel, save_dirname) + infer(use_cuda, save_dirname) + + FULL_TEST = os.getenv('FULL_TEST', '0').lower() in ['true', '1', 't', 'y', 'yes', 'on'] SKIP_REASON = "Only run minimum number of tests in CI server, to make CI faster" @@ -142,7 +206,8 @@ def inject_test_method(use_cuda, is_sparse, parallel): with fluid.program_guard(prog, startup_prog): main(use_cuda=use_cuda, is_sparse=is_sparse, parallel=parallel) - if use_cuda and is_sparse and parallel: + # run only 2 cases: use_cuda is either True or False + if is_sparse == False and parallel == False: fn = __impl__ else: # skip the other test when on CI server -- GitLab From 90648f336d0a73630d0a862259a4f73ab3c9fe8c Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 9 Feb 2018 16:25:12 -0800 Subject: [PATCH 44/55] Move file to fluid/; Edit CMakeLists.txt --- paddle/CMakeLists.txt | 7 +------ paddle/fluid/CMakeLists.txt | 6 ++++++ paddle/{ => fluid}/framework/.clang-format | 0 paddle/{ => fluid}/framework/CMakeLists.txt | 0 paddle/{ => fluid}/framework/attribute.cc | 0 paddle/{ => fluid}/framework/attribute.h | 0 paddle/{ => fluid}/framework/backward.cc | 0 paddle/{ => fluid}/framework/backward.h | 0 paddle/{ => fluid}/framework/backward_test.cc | 0 paddle/{ => fluid}/framework/block_desc.cc | 0 paddle/{ => fluid}/framework/block_desc.h | 0 paddle/{ => fluid}/framework/channel.h | 0 paddle/{ => fluid}/framework/channel_test.cc | 0 .../{ => fluid}/framework/data_device_transform.cc | 0 .../{ => fluid}/framework/data_device_transform.h | 0 .../framework/data_device_transform_test.cu | 0 paddle/{ => fluid}/framework/data_layout.h | 0 .../{ => fluid}/framework/data_layout_transform.cc | 0 .../{ => fluid}/framework/data_layout_transform.h | 0 .../framework/data_layout_transform_test.cc | 0 paddle/{ => fluid}/framework/data_transform.cc | 0 paddle/{ => fluid}/framework/data_transform.h | 0 paddle/{ => fluid}/framework/data_type.h | 0 paddle/{ => fluid}/framework/data_type_transform.cc | 0 paddle/{ => fluid}/framework/data_type_transform.h | 0 .../framework/data_type_transform_test.cc | 0 paddle/{ => fluid}/framework/ddim.cc | 0 paddle/{ => fluid}/framework/ddim.h | 0 paddle/{ => fluid}/framework/ddim_test.cc | 0 .../framework/details/buffered_channel.h | 0 paddle/{ => fluid}/framework/details/cow_ptr.h | 0 .../{ => fluid}/framework/details/cow_ptr_test.cc | 0 paddle/{ => fluid}/framework/details/op_registry.h | 0 .../framework/details/unbuffered_channel.h | 0 paddle/{ => fluid}/framework/dim.h | 0 paddle/{ => fluid}/framework/dim_test.cu | 0 paddle/{ => fluid}/framework/eigen.h | 0 paddle/{ => fluid}/framework/eigen_test.cc | 0 paddle/{ => fluid}/framework/executor.cc | 0 paddle/{ => fluid}/framework/executor.h | 0 paddle/{ => fluid}/framework/feed_fetch_method.cc | 0 paddle/{ => fluid}/framework/feed_fetch_method.h | 0 paddle/{ => fluid}/framework/feed_fetch_type.h | 0 paddle/{ => fluid}/framework/framework.proto | 0 paddle/{ => fluid}/framework/grad_op_desc_maker.h | 0 paddle/{ => fluid}/framework/init.cc | 0 paddle/{ => fluid}/framework/init.h | 0 paddle/{ => fluid}/framework/init_test.cc | 0 paddle/{ => fluid}/framework/library_type.h | 0 paddle/{ => fluid}/framework/lod_rank_table.cc | 0 paddle/{ => fluid}/framework/lod_rank_table.h | 0 paddle/{ => fluid}/framework/lod_tensor.cc | 0 paddle/{ => fluid}/framework/lod_tensor.h | 0 paddle/{ => fluid}/framework/lod_tensor.md | 0 paddle/{ => fluid}/framework/lod_tensor_array.h | 0 paddle/{ => fluid}/framework/lod_tensor_test.cc | 0 paddle/{ => fluid}/framework/lod_tensor_test.cu | 0 paddle/{ => fluid}/framework/mixed_vector.h | 0 paddle/{ => fluid}/framework/mixed_vector_test.cu | 0 paddle/{ => fluid}/framework/op_desc.cc | 0 paddle/{ => fluid}/framework/op_desc.h | 0 paddle/{ => fluid}/framework/op_info.cc | 0 paddle/{ => fluid}/framework/op_info.h | 0 paddle/{ => fluid}/framework/op_kernel_type.h | 0 paddle/{ => fluid}/framework/op_kernel_type_test.cc | 0 paddle/{ => fluid}/framework/op_proto_maker.cc | 0 paddle/{ => fluid}/framework/op_proto_maker.h | 0 paddle/{ => fluid}/framework/op_proto_maker_test.cc | 0 paddle/{ => fluid}/framework/op_registry.cc | 0 paddle/{ => fluid}/framework/op_registry.h | 0 paddle/{ => fluid}/framework/op_registry_test.cc | 0 paddle/{ => fluid}/framework/operator.cc | 0 paddle/{ => fluid}/framework/operator.h | 0 paddle/{ => fluid}/framework/operator_test.cc | 0 paddle/{ => fluid}/framework/program_desc.cc | 0 paddle/{ => fluid}/framework/program_desc.h | 0 paddle/{ => fluid}/framework/program_desc_test.cc | 0 paddle/{ => fluid}/framework/proto_desc.h | 0 paddle/{ => fluid}/framework/prune.cc | 0 paddle/{ => fluid}/framework/prune.h | 0 paddle/{ => fluid}/framework/prune_test.cc | 0 paddle/{ => fluid}/framework/reader.cc | 0 paddle/{ => fluid}/framework/reader.h | 0 paddle/{ => fluid}/framework/scope.cc | 0 paddle/{ => fluid}/framework/scope.h | 0 paddle/{ => fluid}/framework/scope_test.cc | 0 paddle/{ => fluid}/framework/selected_rows.cc | 0 paddle/{ => fluid}/framework/selected_rows.h | 0 paddle/{ => fluid}/framework/selected_rows_test.cc | 0 paddle/{ => fluid}/framework/shape_inference.cc | 0 paddle/{ => fluid}/framework/shape_inference.h | 0 paddle/{ => fluid}/framework/tensor.cc | 0 paddle/{ => fluid}/framework/tensor.h | 0 paddle/{ => fluid}/framework/tensor.md | 0 paddle/{ => fluid}/framework/tensor_impl.h | 0 paddle/{ => fluid}/framework/tensor_test.cc | 0 paddle/{ => fluid}/framework/tensor_util.cc | 0 paddle/{ => fluid}/framework/tensor_util.cu | 0 paddle/{ => fluid}/framework/tensor_util.h | 0 paddle/{ => fluid}/framework/tensor_util_test.cc | 0 paddle/{ => fluid}/framework/tensor_util_test.cu | 0 paddle/{ => fluid}/framework/threadpool.cc | 0 paddle/{ => fluid}/framework/threadpool.h | 0 paddle/{ => fluid}/framework/threadpool_test.cc | 0 paddle/{ => fluid}/framework/type_defs.h | 0 paddle/{ => fluid}/framework/var_desc.cc | 0 paddle/{ => fluid}/framework/var_desc.h | 0 paddle/{ => fluid}/framework/var_type.h | 0 paddle/{ => fluid}/framework/var_type_inference.h | 0 .../framework/var_type_inference_test.cc | 0 paddle/{ => fluid}/framework/variable.h | 0 paddle/{ => fluid}/framework/variable.md | 0 paddle/{ => fluid}/framework/variable_test.cc | 0 paddle/{ => fluid}/inference/CMakeLists.txt | 0 paddle/{ => fluid}/inference/io.cc | 0 paddle/{ => fluid}/inference/io.h | 0 .../{ => fluid}/inference/tests/book/CMakeLists.txt | 0 .../{ => fluid}/inference/tests/book/test_helper.h | 0 .../tests/book/test_inference_fit_a_line.cc | 0 .../book/test_inference_image_classification.cc | 0 .../book/test_inference_label_semantic_roles.cc | 0 .../tests/book/test_inference_recognize_digits.cc | 0 .../tests/book/test_inference_recommender_system.cc | 0 .../book/test_inference_rnn_encoder_decoder.cc | 0 .../book/test_inference_understand_sentiment.cc | 0 .../inference/tests/book/test_inference_word2vec.cc | 0 paddle/{ => fluid}/memory/.clang-format | 0 paddle/{ => fluid}/memory/CMakeLists.txt | 0 paddle/{ => fluid}/memory/README.md | 0 paddle/{ => fluid}/memory/detail/CMakeLists.txt | 0 paddle/{ => fluid}/memory/detail/buddy_allocator.cc | 0 paddle/{ => fluid}/memory/detail/buddy_allocator.h | 0 paddle/{ => fluid}/memory/detail/memory_block.cc | 0 paddle/{ => fluid}/memory/detail/memory_block.h | 0 paddle/{ => fluid}/memory/detail/meta_cache.cc | 0 paddle/{ => fluid}/memory/detail/meta_cache.h | 0 paddle/{ => fluid}/memory/detail/meta_data.cc | 0 paddle/{ => fluid}/memory/detail/meta_data.h | 0 .../{ => fluid}/memory/detail/system_allocator.cc | 0 paddle/{ => fluid}/memory/detail/system_allocator.h | 0 .../memory/detail/system_allocator_test.cc | 0 paddle/{ => fluid}/memory/memcpy.cc | 0 paddle/{ => fluid}/memory/memcpy.h | 0 paddle/{ => fluid}/memory/memory.cc | 0 paddle/{ => fluid}/memory/memory.h | 0 paddle/{ => fluid}/memory/memory_test.cc | 0 paddle/{ => fluid}/operators/.clang-format | 0 paddle/{ => fluid}/operators/CMakeLists.txt | 0 paddle/{ => fluid}/operators/accuracy_op.cc | 0 paddle/{ => fluid}/operators/accuracy_op.cu | 0 paddle/{ => fluid}/operators/accuracy_op.h | 0 paddle/{ => fluid}/operators/activation_op.cc | 0 paddle/{ => fluid}/operators/activation_op.cu | 0 paddle/{ => fluid}/operators/activation_op.h | 0 paddle/{ => fluid}/operators/adadelta_op.cc | 0 paddle/{ => fluid}/operators/adadelta_op.cu | 0 paddle/{ => fluid}/operators/adadelta_op.h | 0 paddle/{ => fluid}/operators/adagrad_op.cc | 0 paddle/{ => fluid}/operators/adagrad_op.cu | 0 paddle/{ => fluid}/operators/adagrad_op.h | 0 paddle/{ => fluid}/operators/adam_op.cc | 0 paddle/{ => fluid}/operators/adam_op.cu | 0 paddle/{ => fluid}/operators/adam_op.h | 0 paddle/{ => fluid}/operators/adamax_op.cc | 0 paddle/{ => fluid}/operators/adamax_op.cu | 0 paddle/{ => fluid}/operators/adamax_op.h | 0 paddle/{ => fluid}/operators/array_operator.h | 0 .../{ => fluid}/operators/array_to_lod_tensor_op.cc | 0 paddle/{ => fluid}/operators/assign_op.cc | 0 paddle/{ => fluid}/operators/assign_value_op.cc | 0 paddle/{ => fluid}/operators/assign_value_op.cu.cc | 0 paddle/{ => fluid}/operators/assign_value_op.h | 0 paddle/{ => fluid}/operators/auc_op.cc | 0 paddle/{ => fluid}/operators/auc_op.h | 0 paddle/{ => fluid}/operators/batch_norm_op.cc | 0 paddle/{ => fluid}/operators/batch_norm_op.cu.cc | 0 paddle/{ => fluid}/operators/batch_norm_op.h | 0 .../{ => fluid}/operators/beam_search_decode_op.cc | 0 .../{ => fluid}/operators/beam_search_decode_op.h | 0 .../operators/beam_search_decode_op_test.cc | 0 paddle/{ => fluid}/operators/beam_search_op.cc | 0 paddle/{ => fluid}/operators/beam_search_op.h | 0 paddle/{ => fluid}/operators/beam_search_op_test.cc | 0 .../operators/bilinear_tensor_product_op.cc | 0 .../operators/bilinear_tensor_product_op.cu | 0 .../operators/bilinear_tensor_product_op.h | 0 paddle/{ => fluid}/operators/bipartite_match_op.cc | 0 paddle/{ => fluid}/operators/box_coder_op.cc | 0 paddle/{ => fluid}/operators/box_coder_op.cu | 0 paddle/{ => fluid}/operators/box_coder_op.h | 0 paddle/{ => fluid}/operators/cast_op.cc | 0 paddle/{ => fluid}/operators/cast_op.cu | 0 paddle/{ => fluid}/operators/cast_op.h | 0 paddle/{ => fluid}/operators/chunk_eval_op.cc | 0 paddle/{ => fluid}/operators/chunk_eval_op.h | 0 paddle/{ => fluid}/operators/clip_by_norm_op.cc | 0 paddle/{ => fluid}/operators/clip_by_norm_op.cu | 0 paddle/{ => fluid}/operators/clip_by_norm_op.h | 0 paddle/{ => fluid}/operators/clip_op.cc | 0 paddle/{ => fluid}/operators/clip_op.cu | 0 paddle/{ => fluid}/operators/clip_op.h | 0 paddle/{ => fluid}/operators/compare_op.cc | 0 paddle/{ => fluid}/operators/compare_op.cu | 0 paddle/{ => fluid}/operators/compare_op.h | 0 paddle/{ => fluid}/operators/concat_op.cc | 0 paddle/{ => fluid}/operators/concat_op.cu.cc | 0 paddle/{ => fluid}/operators/concat_op.h | 0 paddle/{ => fluid}/operators/cond_op.cc | 0 paddle/{ => fluid}/operators/cond_op.h | 0 .../{ => fluid}/operators/conditional_block_op.cc | 0 paddle/{ => fluid}/operators/conv_cudnn_op.cu.cc | 0 paddle/{ => fluid}/operators/conv_op.cc | 0 paddle/{ => fluid}/operators/conv_op.cu.cc | 0 paddle/{ => fluid}/operators/conv_op.h | 0 paddle/{ => fluid}/operators/conv_shift_op.cc | 0 paddle/{ => fluid}/operators/conv_shift_op.cu | 0 paddle/{ => fluid}/operators/conv_shift_op.h | 0 .../operators/conv_transpose_cudnn_op.cu.cc | 0 paddle/{ => fluid}/operators/conv_transpose_op.cc | 0 .../{ => fluid}/operators/conv_transpose_op.cu.cc | 0 paddle/{ => fluid}/operators/conv_transpose_op.h | 0 paddle/{ => fluid}/operators/cos_sim_op.cc | 0 paddle/{ => fluid}/operators/cos_sim_op.cu | 0 paddle/{ => fluid}/operators/cos_sim_op.h | 0 paddle/{ => fluid}/operators/create_reader_op.cc | 0 paddle/{ => fluid}/operators/crf_decoding_op.cc | 0 paddle/{ => fluid}/operators/crf_decoding_op.h | 0 paddle/{ => fluid}/operators/crop_op.cc | 0 paddle/{ => fluid}/operators/crop_op.cu | 0 paddle/{ => fluid}/operators/crop_op.h | 0 paddle/{ => fluid}/operators/cross_entropy_op.cc | 0 paddle/{ => fluid}/operators/cross_entropy_op.cu | 0 paddle/{ => fluid}/operators/cross_entropy_op.h | 0 paddle/{ => fluid}/operators/ctc_align_op.cc | 0 paddle/{ => fluid}/operators/ctc_align_op.cu | 0 paddle/{ => fluid}/operators/ctc_align_op.h | 0 paddle/{ => fluid}/operators/cum_op.h | 0 paddle/{ => fluid}/operators/cumsum_op.cc | 0 paddle/{ => fluid}/operators/cumsum_op.cu | 0 paddle/{ => fluid}/operators/decayed_adagrad_op.cc | 0 paddle/{ => fluid}/operators/decayed_adagrad_op.cu | 0 paddle/{ => fluid}/operators/decayed_adagrad_op.h | 0 paddle/{ => fluid}/operators/detail/CMakeLists.txt | 0 paddle/{ => fluid}/operators/detail/grpc_client.cc | 0 paddle/{ => fluid}/operators/detail/grpc_client.h | 0 paddle/{ => fluid}/operators/detail/grpc_server.cc | 0 paddle/{ => fluid}/operators/detail/grpc_server.h | 0 paddle/{ => fluid}/operators/detail/safe_ref.h | 0 paddle/{ => fluid}/operators/detail/send_recv.proto | 0 .../operators/detail/sendrecvop_utils.cc | 0 .../{ => fluid}/operators/detail/sendrecvop_utils.h | 0 .../operators/detail/simple_block_queue.h | 0 .../{ => fluid}/operators/detail/strided_memcpy.h | 0 paddle/{ => fluid}/operators/detection_output_op.cc | 0 .../{ => fluid}/operators/detection_output_op.cu.cc | 0 paddle/{ => fluid}/operators/detection_output_op.h | 0 paddle/{ => fluid}/operators/dropout_op.cc | 0 paddle/{ => fluid}/operators/dropout_op.cu | 0 paddle/{ => fluid}/operators/dropout_op.h | 0 paddle/{ => fluid}/operators/edit_distance_op.cc | 0 paddle/{ => fluid}/operators/edit_distance_op.cu | 0 paddle/{ => fluid}/operators/edit_distance_op.h | 0 paddle/{ => fluid}/operators/elementwise_add_op.cc | 0 paddle/{ => fluid}/operators/elementwise_add_op.cu | 0 paddle/{ => fluid}/operators/elementwise_add_op.h | 0 paddle/{ => fluid}/operators/elementwise_div_op.cc | 0 paddle/{ => fluid}/operators/elementwise_div_op.cu | 0 paddle/{ => fluid}/operators/elementwise_div_op.h | 0 paddle/{ => fluid}/operators/elementwise_max_op.cc | 0 paddle/{ => fluid}/operators/elementwise_max_op.cu | 0 paddle/{ => fluid}/operators/elementwise_max_op.h | 0 paddle/{ => fluid}/operators/elementwise_min_op.cc | 0 paddle/{ => fluid}/operators/elementwise_min_op.cu | 0 paddle/{ => fluid}/operators/elementwise_min_op.h | 0 paddle/{ => fluid}/operators/elementwise_mul_op.cc | 0 paddle/{ => fluid}/operators/elementwise_mul_op.cu | 0 paddle/{ => fluid}/operators/elementwise_mul_op.h | 0 paddle/{ => fluid}/operators/elementwise_op.h | 0 .../{ => fluid}/operators/elementwise_op_function.h | 0 paddle/{ => fluid}/operators/elementwise_pow_op.cc | 0 paddle/{ => fluid}/operators/elementwise_pow_op.cu | 0 paddle/{ => fluid}/operators/elementwise_pow_op.h | 0 paddle/{ => fluid}/operators/elementwise_sub_op.cc | 0 paddle/{ => fluid}/operators/elementwise_sub_op.cu | 0 paddle/{ => fluid}/operators/elementwise_sub_op.h | 0 paddle/{ => fluid}/operators/expand_op.cc | 0 paddle/{ => fluid}/operators/expand_op.cu | 0 paddle/{ => fluid}/operators/expand_op.h | 0 paddle/{ => fluid}/operators/feed_op.cc | 0 paddle/{ => fluid}/operators/fetch_op.cc | 0 .../operators/fill_constant_batch_size_like_op.cc | 0 .../fill_constant_batch_size_like_op.cu.cc | 0 .../operators/fill_constant_batch_size_like_op.h | 0 paddle/{ => fluid}/operators/fill_constant_op.cc | 0 paddle/{ => fluid}/operators/fill_op.cc | 0 paddle/{ => fluid}/operators/fill_zeros_like_op.cc | 0 .../{ => fluid}/operators/fill_zeros_like_op.cu.cc | 0 paddle/{ => fluid}/operators/fill_zeros_like_op.h | 0 paddle/{ => fluid}/operators/ftrl_op.cc | 0 paddle/{ => fluid}/operators/ftrl_op.cu | 0 paddle/{ => fluid}/operators/ftrl_op.h | 0 paddle/{ => fluid}/operators/gather.cu.h | 0 paddle/{ => fluid}/operators/gather.h | 0 paddle/{ => fluid}/operators/gather_op.cc | 0 paddle/{ => fluid}/operators/gather_op.cu | 0 paddle/{ => fluid}/operators/gather_op.h | 0 paddle/{ => fluid}/operators/gather_test.cc | 0 paddle/{ => fluid}/operators/gaussian_random_op.cc | 0 paddle/{ => fluid}/operators/gaussian_random_op.cu | 0 paddle/{ => fluid}/operators/get_places_op.cc | 0 paddle/{ => fluid}/operators/gru_op.cc | 0 paddle/{ => fluid}/operators/gru_op.cu.cc | 0 paddle/{ => fluid}/operators/gru_op.h | 0 paddle/{ => fluid}/operators/gru_unit_op.cc | 0 paddle/{ => fluid}/operators/gru_unit_op.cu | 0 paddle/{ => fluid}/operators/gru_unit_op.h | 0 paddle/{ => fluid}/operators/hinge_loss_op.cc | 0 paddle/{ => fluid}/operators/hinge_loss_op.cu | 0 paddle/{ => fluid}/operators/hinge_loss_op.h | 0 paddle/{ => fluid}/operators/huber_loss_op.cc | 0 paddle/{ => fluid}/operators/huber_loss_op.cu | 0 paddle/{ => fluid}/operators/huber_loss_op.h | 0 paddle/{ => fluid}/operators/im2sequence_op.cc | 0 paddle/{ => fluid}/operators/im2sequence_op.cu | 0 paddle/{ => fluid}/operators/im2sequence_op.h | 0 .../operators/images/batch_norm_fork.dot | 0 .../operators/images/batch_norm_fork.png | Bin .../operators/images/batch_norm_op_kernel.png | Bin paddle/{ => fluid}/operators/increment_op.cc | 0 paddle/{ => fluid}/operators/iou_similarity_op.cc | 0 paddle/{ => fluid}/operators/iou_similarity_op.cu | 0 paddle/{ => fluid}/operators/iou_similarity_op.h | 0 paddle/{ => fluid}/operators/is_empty_op.cc | 0 paddle/{ => fluid}/operators/l1_norm_op.cc | 0 paddle/{ => fluid}/operators/l1_norm_op.cu | 0 paddle/{ => fluid}/operators/l1_norm_op.h | 0 paddle/{ => fluid}/operators/label_smooth_op.cc | 0 paddle/{ => fluid}/operators/label_smooth_op.cu | 0 paddle/{ => fluid}/operators/label_smooth_op.h | 0 paddle/{ => fluid}/operators/layer_norm_op.cc | 0 paddle/{ => fluid}/operators/layer_norm_op.cu | 0 paddle/{ => fluid}/operators/layer_norm_op.h | 0 paddle/{ => fluid}/operators/linear_chain_crf_op.cc | 0 paddle/{ => fluid}/operators/linear_chain_crf_op.cu | 0 paddle/{ => fluid}/operators/linear_chain_crf_op.h | 0 paddle/{ => fluid}/operators/listen_and_serv_op.cc | 0 paddle/{ => fluid}/operators/load_combine_op.cc | 0 paddle/{ => fluid}/operators/load_op.cc | 0 paddle/{ => fluid}/operators/lod_array_length_op.cc | 0 paddle/{ => fluid}/operators/lod_rank_table_op.cc | 0 paddle/{ => fluid}/operators/lod_reset_op.cc | 0 paddle/{ => fluid}/operators/lod_reset_op.cu | 0 paddle/{ => fluid}/operators/lod_reset_op.h | 0 .../{ => fluid}/operators/lod_tensor_to_array_op.cc | 0 paddle/{ => fluid}/operators/log_loss_op.cc | 0 paddle/{ => fluid}/operators/log_loss_op.cu | 0 paddle/{ => fluid}/operators/log_loss_op.h | 0 paddle/{ => fluid}/operators/logical_op.cc | 0 paddle/{ => fluid}/operators/logical_op.cu | 0 paddle/{ => fluid}/operators/logical_op.h | 0 paddle/{ => fluid}/operators/lookup_table_op.cc | 0 paddle/{ => fluid}/operators/lookup_table_op.cu | 0 paddle/{ => fluid}/operators/lookup_table_op.h | 0 paddle/{ => fluid}/operators/lrn_op.cc | 0 paddle/{ => fluid}/operators/lrn_op.cu | 0 paddle/{ => fluid}/operators/lrn_op.h | 0 paddle/{ => fluid}/operators/lstm_op.cc | 0 paddle/{ => fluid}/operators/lstm_op.cu.cc | 0 paddle/{ => fluid}/operators/lstm_op.h | 0 paddle/{ => fluid}/operators/lstm_unit_op.cc | 0 paddle/{ => fluid}/operators/lstm_unit_op.cu | 0 paddle/{ => fluid}/operators/lstm_unit_op.h | 0 paddle/{ => fluid}/operators/lstmp_op.cc | 0 paddle/{ => fluid}/operators/lstmp_op.cu | 0 paddle/{ => fluid}/operators/lstmp_op.h | 0 paddle/{ => fluid}/operators/margin_rank_loss_op.cc | 0 paddle/{ => fluid}/operators/margin_rank_loss_op.cu | 0 paddle/{ => fluid}/operators/margin_rank_loss_op.h | 0 paddle/{ => fluid}/operators/math/CMakeLists.txt | 0 .../{ => fluid}/operators/math/context_project.cc | 0 .../{ => fluid}/operators/math/context_project.cu | 0 paddle/{ => fluid}/operators/math/context_project.h | 0 .../{ => fluid}/operators/math/cos_sim_functor.cc | 0 .../{ => fluid}/operators/math/cos_sim_functor.cu | 0 paddle/{ => fluid}/operators/math/cos_sim_functor.h | 0 paddle/{ => fluid}/operators/math/cross_entropy.cc | 0 paddle/{ => fluid}/operators/math/cross_entropy.cu | 0 paddle/{ => fluid}/operators/math/cross_entropy.h | 0 paddle/{ => fluid}/operators/math/depthwise_conv.cu | 0 paddle/{ => fluid}/operators/math/depthwise_conv.h | 0 .../operators/math/detail/CMakeLists.txt | 0 .../operators/math/detail/activation_functions.h | 0 .../operators/math/detail/avx_functions.cc | 0 .../operators/math/detail/gru_cpu_kernel.h | 0 .../operators/math/detail/gru_gpu_kernel.h | 0 .../{ => fluid}/operators/math/detail/gru_kernel.h | 0 .../operators/math/detail/lstm_cpu_kernel.h | 0 .../operators/math/detail/lstm_gpu_kernel.h | 0 .../{ => fluid}/operators/math/detail/lstm_kernel.h | 0 paddle/{ => fluid}/operators/math/detection_util.h | 0 paddle/{ => fluid}/operators/math/gru_compute.cc | 0 paddle/{ => fluid}/operators/math/gru_compute.cu | 0 paddle/{ => fluid}/operators/math/gru_compute.h | 0 paddle/{ => fluid}/operators/math/im2col.cc | 0 paddle/{ => fluid}/operators/math/im2col.cu | 0 paddle/{ => fluid}/operators/math/im2col.h | 0 paddle/{ => fluid}/operators/math/im2col_test.cc | 0 paddle/{ => fluid}/operators/math/lstm_compute.cc | 0 paddle/{ => fluid}/operators/math/lstm_compute.cu | 0 paddle/{ => fluid}/operators/math/lstm_compute.h | 0 paddle/{ => fluid}/operators/math/math_function.cc | 0 paddle/{ => fluid}/operators/math/math_function.cu | 0 paddle/{ => fluid}/operators/math/math_function.h | 0 .../{ => fluid}/operators/math/math_function_impl.h | 0 .../operators/math/math_function_test.cc | 0 .../operators/math/math_function_test.cu | 0 paddle/{ => fluid}/operators/math/matmul.h | 0 paddle/{ => fluid}/operators/math/maxouting.cc | 0 paddle/{ => fluid}/operators/math/maxouting.cu | 0 paddle/{ => fluid}/operators/math/maxouting.h | 0 paddle/{ => fluid}/operators/math/pooling.cc | 0 paddle/{ => fluid}/operators/math/pooling.cu | 0 paddle/{ => fluid}/operators/math/pooling.h | 0 paddle/{ => fluid}/operators/math/sampler.cc | 0 paddle/{ => fluid}/operators/math/sampler.h | 0 .../operators/math/selected_rows_functor.cc | 0 .../operators/math/selected_rows_functor.cu | 0 .../operators/math/selected_rows_functor.h | 0 .../operators/math/selected_rows_functor_test.cc | 0 .../operators/math/selected_rows_functor_test.cu | 0 paddle/{ => fluid}/operators/math/sequence2batch.cc | 0 paddle/{ => fluid}/operators/math/sequence2batch.cu | 0 paddle/{ => fluid}/operators/math/sequence2batch.h | 0 .../{ => fluid}/operators/math/sequence_padding.cc | 0 .../{ => fluid}/operators/math/sequence_padding.cu | 0 .../{ => fluid}/operators/math/sequence_padding.h | 0 .../operators/math/sequence_padding_test.cc | 0 .../{ => fluid}/operators/math/sequence_pooling.cc | 0 .../{ => fluid}/operators/math/sequence_pooling.cu | 0 .../{ => fluid}/operators/math/sequence_pooling.h | 0 paddle/{ => fluid}/operators/math/sequence_scale.cc | 0 paddle/{ => fluid}/operators/math/sequence_scale.cu | 0 paddle/{ => fluid}/operators/math/sequence_scale.h | 0 paddle/{ => fluid}/operators/math/softmax.cc | 0 paddle/{ => fluid}/operators/math/softmax.cu | 0 paddle/{ => fluid}/operators/math/softmax.h | 0 paddle/{ => fluid}/operators/math/softmax_impl.h | 0 paddle/{ => fluid}/operators/math/unpooling.cc | 0 paddle/{ => fluid}/operators/math/unpooling.cu | 0 paddle/{ => fluid}/operators/math/unpooling.h | 0 paddle/{ => fluid}/operators/math/vol2col.cc | 0 paddle/{ => fluid}/operators/math/vol2col.cu | 0 paddle/{ => fluid}/operators/math/vol2col.h | 0 paddle/{ => fluid}/operators/math/vol2col_test.cc | 0 paddle/{ => fluid}/operators/matmul_op.cc | 0 paddle/{ => fluid}/operators/matmul_op.cu.cc | 0 paddle/{ => fluid}/operators/matmul_op.h | 0 paddle/{ => fluid}/operators/max_sequence_len_op.cc | 0 paddle/{ => fluid}/operators/maxout_op.cc | 0 paddle/{ => fluid}/operators/maxout_op.cu.cc | 0 paddle/{ => fluid}/operators/maxout_op.h | 0 paddle/{ => fluid}/operators/mean_op.cc | 0 paddle/{ => fluid}/operators/mean_op.cu | 0 paddle/{ => fluid}/operators/mean_op.h | 0 paddle/{ => fluid}/operators/merge_lod_tensor_op.cc | 0 .../{ => fluid}/operators/mine_hard_examples_op.cc | 0 paddle/{ => fluid}/operators/minus_op.cc | 0 paddle/{ => fluid}/operators/minus_op.cu | 0 paddle/{ => fluid}/operators/minus_op.h | 0 .../{ => fluid}/operators/modified_huber_loss_op.cc | 0 .../{ => fluid}/operators/modified_huber_loss_op.cu | 0 .../{ => fluid}/operators/modified_huber_loss_op.h | 0 paddle/{ => fluid}/operators/momentum_op.cc | 0 paddle/{ => fluid}/operators/momentum_op.cu | 0 paddle/{ => fluid}/operators/momentum_op.h | 0 paddle/{ => fluid}/operators/mul_op.cc | 0 paddle/{ => fluid}/operators/mul_op.cu.cc | 0 paddle/{ => fluid}/operators/mul_op.h | 0 paddle/{ => fluid}/operators/multiclass_nms_op.cc | 0 paddle/{ => fluid}/operators/multiplex_op.cc | 0 paddle/{ => fluid}/operators/multiplex_op.cu | 0 paddle/{ => fluid}/operators/multiplex_op.h | 0 paddle/{ => fluid}/operators/nccl/CMakeLists.txt | 0 .../{ => fluid}/operators/nccl/nccl_gpu_common.cc | 0 paddle/{ => fluid}/operators/nccl/nccl_gpu_common.h | 0 paddle/{ => fluid}/operators/nccl_op.cc | 0 paddle/{ => fluid}/operators/nccl_op.cu.cc | 0 paddle/{ => fluid}/operators/nccl_op_test.cu.cc | 0 paddle/{ => fluid}/operators/nce_op.cc | 0 paddle/{ => fluid}/operators/nce_op.h | 0 paddle/{ => fluid}/operators/net_op.cc | 0 paddle/{ => fluid}/operators/net_op.h | 0 paddle/{ => fluid}/operators/net_op_test.cc | 0 paddle/{ => fluid}/operators/norm_op.cc | 0 paddle/{ => fluid}/operators/norm_op.cu | 0 paddle/{ => fluid}/operators/norm_op.h | 0 paddle/{ => fluid}/operators/one_hot_op.cc | 0 paddle/{ => fluid}/operators/one_hot_op.cu | 0 paddle/{ => fluid}/operators/one_hot_op.h | 0 .../operators/op_documentation/batch_norm_op.md | 0 .../operators/op_documentation/name_convention.md | 0 .../operators/op_documentation/net_op_design.md | 0 .../op_documentation/op_markdown_format.md | 0 .../operators/op_documentation/rnn_design.md | 0 paddle/{ => fluid}/operators/pad_op.cc | 0 paddle/{ => fluid}/operators/pad_op.cu | 0 paddle/{ => fluid}/operators/pad_op.h | 0 paddle/{ => fluid}/operators/parallel_do_op.cc | 0 paddle/{ => fluid}/operators/pool_cudnn_op.cu.cc | 0 paddle/{ => fluid}/operators/pool_op.cc | 0 paddle/{ => fluid}/operators/pool_op.cu.cc | 0 paddle/{ => fluid}/operators/pool_op.h | 0 paddle/{ => fluid}/operators/pool_with_index_op.cc | 0 .../{ => fluid}/operators/pool_with_index_op.cu.cc | 0 paddle/{ => fluid}/operators/pool_with_index_op.h | 0 .../operators/positive_negative_pair_op.cc | 0 .../operators/positive_negative_pair_op.h | 0 paddle/{ => fluid}/operators/precision_recall_op.cc | 0 paddle/{ => fluid}/operators/precision_recall_op.h | 0 paddle/{ => fluid}/operators/prelu_op.cc | 0 paddle/{ => fluid}/operators/prelu_op.cu | 0 paddle/{ => fluid}/operators/prelu_op.h | 0 paddle/{ => fluid}/operators/print_op.cc | 0 paddle/{ => fluid}/operators/prior_box_op.cc | 0 paddle/{ => fluid}/operators/prior_box_op.h | 0 paddle/{ => fluid}/operators/proximal_adagrad_op.cc | 0 paddle/{ => fluid}/operators/proximal_adagrad_op.cu | 0 paddle/{ => fluid}/operators/proximal_adagrad_op.h | 0 paddle/{ => fluid}/operators/proximal_gd_op.cc | 0 paddle/{ => fluid}/operators/proximal_gd_op.cu | 0 paddle/{ => fluid}/operators/proximal_gd_op.h | 0 paddle/{ => fluid}/operators/rank_loss_op.cc | 0 paddle/{ => fluid}/operators/rank_loss_op.cu | 0 paddle/{ => fluid}/operators/rank_loss_op.h | 0 paddle/{ => fluid}/operators/read_op.cc | 0 paddle/{ => fluid}/operators/recurrent_op.cc | 0 paddle/{ => fluid}/operators/recv_op.cc | 0 paddle/{ => fluid}/operators/reduce_op.cc | 0 paddle/{ => fluid}/operators/reduce_op.cu | 0 paddle/{ => fluid}/operators/reduce_op.h | 0 .../operators/reorder_lod_tensor_by_rank_op.cc | 0 paddle/{ => fluid}/operators/reshape_op.cc | 0 paddle/{ => fluid}/operators/reshape_op.cu | 0 paddle/{ => fluid}/operators/reshape_op.h | 0 paddle/{ => fluid}/operators/rmsprop_op.cc | 0 paddle/{ => fluid}/operators/rmsprop_op.cu | 0 paddle/{ => fluid}/operators/rmsprop_op.h | 0 .../{ => fluid}/operators/rnn_memory_helper_op.cc | 0 paddle/{ => fluid}/operators/roi_pool_op.cc | 0 paddle/{ => fluid}/operators/roi_pool_op.cu | 0 paddle/{ => fluid}/operators/roi_pool_op.h | 0 paddle/{ => fluid}/operators/row_conv_op.cc | 0 paddle/{ => fluid}/operators/row_conv_op.cu | 0 paddle/{ => fluid}/operators/row_conv_op.h | 0 paddle/{ => fluid}/operators/save_combine_op.cc | 0 .../operators/save_load_combine_op_test.cc | 0 paddle/{ => fluid}/operators/save_load_op_test.cc | 0 paddle/{ => fluid}/operators/save_op.cc | 0 paddle/{ => fluid}/operators/scale_op.cc | 0 paddle/{ => fluid}/operators/scale_op.cu | 0 paddle/{ => fluid}/operators/scale_op.h | 0 paddle/{ => fluid}/operators/scatter.cu.h | 0 paddle/{ => fluid}/operators/scatter.h | 0 paddle/{ => fluid}/operators/scatter_op.cc | 0 paddle/{ => fluid}/operators/scatter_op.cu | 0 paddle/{ => fluid}/operators/scatter_op.h | 0 paddle/{ => fluid}/operators/scatter_test.cc | 0 paddle/{ => fluid}/operators/send_op.cc | 0 paddle/{ => fluid}/operators/send_recv_op_test.cc | 0 paddle/{ => fluid}/operators/sequence_concat_op.cc | 0 .../{ => fluid}/operators/sequence_concat_op.cu.cc | 0 paddle/{ => fluid}/operators/sequence_concat_op.h | 0 paddle/{ => fluid}/operators/sequence_conv_op.cc | 0 paddle/{ => fluid}/operators/sequence_conv_op.cu.cc | 0 paddle/{ => fluid}/operators/sequence_conv_op.h | 0 paddle/{ => fluid}/operators/sequence_erase_op.cc | 0 paddle/{ => fluid}/operators/sequence_erase_op.cu | 0 paddle/{ => fluid}/operators/sequence_erase_op.h | 0 paddle/{ => fluid}/operators/sequence_expand_op.cc | 0 paddle/{ => fluid}/operators/sequence_expand_op.cu | 0 paddle/{ => fluid}/operators/sequence_expand_op.h | 0 paddle/{ => fluid}/operators/sequence_pool_op.cc | 0 paddle/{ => fluid}/operators/sequence_pool_op.cu | 0 paddle/{ => fluid}/operators/sequence_pool_op.h | 0 paddle/{ => fluid}/operators/sequence_reshape_op.cc | 0 paddle/{ => fluid}/operators/sequence_reshape_op.cu | 0 paddle/{ => fluid}/operators/sequence_reshape_op.h | 0 paddle/{ => fluid}/operators/sequence_slice_op.cc | 0 paddle/{ => fluid}/operators/sequence_slice_op.cu | 0 paddle/{ => fluid}/operators/sequence_slice_op.h | 0 paddle/{ => fluid}/operators/sequence_softmax_op.cc | 0 .../{ => fluid}/operators/sequence_softmax_op.cu.cc | 0 paddle/{ => fluid}/operators/sequence_softmax_op.h | 0 paddle/{ => fluid}/operators/sgd_op.cc | 0 paddle/{ => fluid}/operators/sgd_op.cu | 0 paddle/{ => fluid}/operators/sgd_op.h | 0 .../{ => fluid}/operators/shrink_rnn_memory_op.cc | 0 .../sigmoid_cross_entropy_with_logits_op.cc | 0 .../sigmoid_cross_entropy_with_logits_op.cu | 0 .../sigmoid_cross_entropy_with_logits_op.h | 0 paddle/{ => fluid}/operators/sign_op.cc | 0 paddle/{ => fluid}/operators/sign_op.cu | 0 paddle/{ => fluid}/operators/sign_op.h | 0 paddle/{ => fluid}/operators/smooth_l1_loss_op.cc | 0 paddle/{ => fluid}/operators/smooth_l1_loss_op.cu | 0 paddle/{ => fluid}/operators/smooth_l1_loss_op.h | 0 paddle/{ => fluid}/operators/softmax_op.cc | 0 paddle/{ => fluid}/operators/softmax_op.cu.cc | 0 paddle/{ => fluid}/operators/softmax_op.h | 0 .../operators/softmax_with_cross_entropy_op.cc | 0 .../operators/softmax_with_cross_entropy_op.cu | 0 .../operators/softmax_with_cross_entropy_op.h | 0 paddle/{ => fluid}/operators/split_lod_tensor_op.cc | 0 paddle/{ => fluid}/operators/split_op.cc | 0 paddle/{ => fluid}/operators/split_op.cu.cc | 0 paddle/{ => fluid}/operators/split_op.h | 0 .../{ => fluid}/operators/split_selected_rows_op.cc | 0 .../{ => fluid}/operators/split_selected_rows_op.cu | 0 .../{ => fluid}/operators/split_selected_rows_op.h | 0 paddle/{ => fluid}/operators/spp_op.cc | 0 paddle/{ => fluid}/operators/spp_op.cu.cc | 0 paddle/{ => fluid}/operators/spp_op.h | 0 .../{ => fluid}/operators/squared_l2_distance_op.cc | 0 .../{ => fluid}/operators/squared_l2_distance_op.cu | 0 .../{ => fluid}/operators/squared_l2_distance_op.h | 0 paddle/{ => fluid}/operators/squared_l2_norm_op.cc | 0 paddle/{ => fluid}/operators/squared_l2_norm_op.cu | 0 paddle/{ => fluid}/operators/squared_l2_norm_op.h | 0 paddle/{ => fluid}/operators/strided_memcpy.h | 0 paddle/{ => fluid}/operators/strided_memcpy_test.cc | 0 paddle/{ => fluid}/operators/sum_op.cc | 0 paddle/{ => fluid}/operators/sum_op.cu | 0 paddle/{ => fluid}/operators/sum_op.h | 0 paddle/{ => fluid}/operators/target_assign_op.cc | 0 paddle/{ => fluid}/operators/target_assign_op.cu | 0 paddle/{ => fluid}/operators/target_assign_op.h | 0 .../operators/tensor_array_read_write_op.cc | 0 paddle/{ => fluid}/operators/top_k_op.cc | 0 paddle/{ => fluid}/operators/top_k_op.cu | 0 paddle/{ => fluid}/operators/top_k_op.h | 0 paddle/{ => fluid}/operators/transpose_op.cc | 0 paddle/{ => fluid}/operators/transpose_op.cu.cc | 0 paddle/{ => fluid}/operators/transpose_op.h | 0 paddle/{ => fluid}/operators/uniform_random_op.cc | 0 paddle/{ => fluid}/operators/uniform_random_op.cu | 0 paddle/{ => fluid}/operators/unpool_op.cc | 0 paddle/{ => fluid}/operators/unpool_op.cu.cc | 0 paddle/{ => fluid}/operators/unpool_op.h | 0 paddle/{ => fluid}/operators/warpctc_op.cc | 0 paddle/{ => fluid}/operators/warpctc_op.cu.cc | 0 paddle/{ => fluid}/operators/warpctc_op.h | 0 paddle/{ => fluid}/operators/while_op.cc | 0 paddle/{ => fluid}/platform/.clang-format | 0 paddle/{ => fluid}/platform/CMakeLists.txt | 0 paddle/{ => fluid}/platform/assert.h | 0 paddle/{ => fluid}/platform/call_once.h | 0 paddle/{ => fluid}/platform/cpu_info.cc | 0 paddle/{ => fluid}/platform/cpu_info.h | 0 paddle/{ => fluid}/platform/cpu_info_test.cc | 0 paddle/{ => fluid}/platform/cuda_helper.h | 0 paddle/{ => fluid}/platform/cuda_profiler.h | 0 paddle/{ => fluid}/platform/cudnn_helper.h | 0 paddle/{ => fluid}/platform/cudnn_helper_test.cc | 0 .../{ => fluid}/platform/details/device_ptr_cast.h | 0 paddle/{ => fluid}/platform/device_context.cc | 0 paddle/{ => fluid}/platform/device_context.h | 0 paddle/{ => fluid}/platform/device_context_test.cu | 0 paddle/{ => fluid}/platform/dynload/CMakeLists.txt | 0 paddle/{ => fluid}/platform/dynload/cublas.cc | 0 paddle/{ => fluid}/platform/dynload/cublas.h | 0 paddle/{ => fluid}/platform/dynload/cudnn.cc | 0 paddle/{ => fluid}/platform/dynload/cudnn.h | 0 paddle/{ => fluid}/platform/dynload/curand.cc | 0 paddle/{ => fluid}/platform/dynload/curand.h | 0 .../{ => fluid}/platform/dynload/dynamic_loader.cc | 0 .../{ => fluid}/platform/dynload/dynamic_loader.h | 0 paddle/{ => fluid}/platform/dynload/nccl.cc | 0 paddle/{ => fluid}/platform/dynload/nccl.h | 0 paddle/{ => fluid}/platform/dynload/warpctc.cc | 0 paddle/{ => fluid}/platform/dynload/warpctc.h | 0 paddle/{ => fluid}/platform/enforce.cc | 0 paddle/{ => fluid}/platform/enforce.h | 0 paddle/{ => fluid}/platform/enforce_test.cc | 0 paddle/{ => fluid}/platform/for_range.h | 0 paddle/{ => fluid}/platform/gpu_info.cc | 0 paddle/{ => fluid}/platform/gpu_info.h | 0 paddle/{ => fluid}/platform/hostdevice.h | 0 paddle/{ => fluid}/platform/macros.h | 0 paddle/{ => fluid}/platform/mkldnn_helper.h | 0 paddle/{ => fluid}/platform/nccl_test.cu | 0 paddle/{ => fluid}/platform/place.cc | 0 paddle/{ => fluid}/platform/place.h | 0 paddle/{ => fluid}/platform/place_test.cc | 0 paddle/{ => fluid}/platform/profiler.cc | 0 paddle/{ => fluid}/platform/profiler.h | 0 paddle/{ => fluid}/platform/profiler_test.cc | 0 paddle/{ => fluid}/platform/transform.h | 0 paddle/{ => fluid}/platform/transform_test.cu | 0 paddle/{ => fluid}/platform/variant.h | 0 paddle/{ => fluid}/pybind/.clang-format | 0 paddle/{ => fluid}/pybind/CMakeLists.txt | 0 paddle/{ => fluid}/pybind/const_value.cc | 0 paddle/{ => fluid}/pybind/const_value.h | 0 paddle/{ => fluid}/pybind/exception.cc | 0 paddle/{ => fluid}/pybind/exception.h | 0 paddle/{ => fluid}/pybind/protobuf.cc | 0 paddle/{ => fluid}/pybind/protobuf.h | 0 paddle/{ => fluid}/pybind/pybind.cc | 0 paddle/{ => fluid}/pybind/tensor_py.h | 0 709 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 paddle/fluid/CMakeLists.txt rename paddle/{ => fluid}/framework/.clang-format (100%) rename paddle/{ => fluid}/framework/CMakeLists.txt (100%) rename paddle/{ => fluid}/framework/attribute.cc (100%) rename paddle/{ => fluid}/framework/attribute.h (100%) rename paddle/{ => fluid}/framework/backward.cc (100%) rename paddle/{ => fluid}/framework/backward.h (100%) rename paddle/{ => fluid}/framework/backward_test.cc (100%) rename paddle/{ => fluid}/framework/block_desc.cc (100%) rename paddle/{ => fluid}/framework/block_desc.h (100%) rename paddle/{ => fluid}/framework/channel.h (100%) rename paddle/{ => fluid}/framework/channel_test.cc (100%) rename paddle/{ => fluid}/framework/data_device_transform.cc (100%) rename paddle/{ => fluid}/framework/data_device_transform.h (100%) rename paddle/{ => fluid}/framework/data_device_transform_test.cu (100%) rename paddle/{ => fluid}/framework/data_layout.h (100%) rename paddle/{ => fluid}/framework/data_layout_transform.cc (100%) rename paddle/{ => fluid}/framework/data_layout_transform.h (100%) rename paddle/{ => fluid}/framework/data_layout_transform_test.cc (100%) rename paddle/{ => fluid}/framework/data_transform.cc (100%) rename paddle/{ => fluid}/framework/data_transform.h (100%) rename paddle/{ => fluid}/framework/data_type.h (100%) rename paddle/{ => fluid}/framework/data_type_transform.cc (100%) rename paddle/{ => fluid}/framework/data_type_transform.h (100%) rename paddle/{ => fluid}/framework/data_type_transform_test.cc (100%) rename paddle/{ => fluid}/framework/ddim.cc (100%) rename paddle/{ => fluid}/framework/ddim.h (100%) rename paddle/{ => fluid}/framework/ddim_test.cc (100%) rename paddle/{ => fluid}/framework/details/buffered_channel.h (100%) rename paddle/{ => fluid}/framework/details/cow_ptr.h (100%) rename paddle/{ => fluid}/framework/details/cow_ptr_test.cc (100%) rename paddle/{ => fluid}/framework/details/op_registry.h (100%) rename paddle/{ => fluid}/framework/details/unbuffered_channel.h (100%) rename paddle/{ => fluid}/framework/dim.h (100%) rename paddle/{ => fluid}/framework/dim_test.cu (100%) rename paddle/{ => fluid}/framework/eigen.h (100%) rename paddle/{ => fluid}/framework/eigen_test.cc (100%) rename paddle/{ => fluid}/framework/executor.cc (100%) rename paddle/{ => fluid}/framework/executor.h (100%) rename paddle/{ => fluid}/framework/feed_fetch_method.cc (100%) rename paddle/{ => fluid}/framework/feed_fetch_method.h (100%) rename paddle/{ => fluid}/framework/feed_fetch_type.h (100%) rename paddle/{ => fluid}/framework/framework.proto (100%) rename paddle/{ => fluid}/framework/grad_op_desc_maker.h (100%) rename paddle/{ => fluid}/framework/init.cc (100%) rename paddle/{ => fluid}/framework/init.h (100%) rename paddle/{ => fluid}/framework/init_test.cc (100%) rename paddle/{ => fluid}/framework/library_type.h (100%) rename paddle/{ => fluid}/framework/lod_rank_table.cc (100%) rename paddle/{ => fluid}/framework/lod_rank_table.h (100%) rename paddle/{ => fluid}/framework/lod_tensor.cc (100%) rename paddle/{ => fluid}/framework/lod_tensor.h (100%) rename paddle/{ => fluid}/framework/lod_tensor.md (100%) rename paddle/{ => fluid}/framework/lod_tensor_array.h (100%) rename paddle/{ => fluid}/framework/lod_tensor_test.cc (100%) rename paddle/{ => fluid}/framework/lod_tensor_test.cu (100%) rename paddle/{ => fluid}/framework/mixed_vector.h (100%) rename paddle/{ => fluid}/framework/mixed_vector_test.cu (100%) rename paddle/{ => fluid}/framework/op_desc.cc (100%) rename paddle/{ => fluid}/framework/op_desc.h (100%) rename paddle/{ => fluid}/framework/op_info.cc (100%) rename paddle/{ => fluid}/framework/op_info.h (100%) rename paddle/{ => fluid}/framework/op_kernel_type.h (100%) rename paddle/{ => fluid}/framework/op_kernel_type_test.cc (100%) rename paddle/{ => fluid}/framework/op_proto_maker.cc (100%) rename paddle/{ => fluid}/framework/op_proto_maker.h (100%) rename paddle/{ => fluid}/framework/op_proto_maker_test.cc (100%) rename paddle/{ => fluid}/framework/op_registry.cc (100%) rename paddle/{ => fluid}/framework/op_registry.h (100%) rename paddle/{ => fluid}/framework/op_registry_test.cc (100%) rename paddle/{ => fluid}/framework/operator.cc (100%) rename paddle/{ => fluid}/framework/operator.h (100%) rename paddle/{ => fluid}/framework/operator_test.cc (100%) rename paddle/{ => fluid}/framework/program_desc.cc (100%) rename paddle/{ => fluid}/framework/program_desc.h (100%) rename paddle/{ => fluid}/framework/program_desc_test.cc (100%) rename paddle/{ => fluid}/framework/proto_desc.h (100%) rename paddle/{ => fluid}/framework/prune.cc (100%) rename paddle/{ => fluid}/framework/prune.h (100%) rename paddle/{ => fluid}/framework/prune_test.cc (100%) rename paddle/{ => fluid}/framework/reader.cc (100%) rename paddle/{ => fluid}/framework/reader.h (100%) rename paddle/{ => fluid}/framework/scope.cc (100%) rename paddle/{ => fluid}/framework/scope.h (100%) rename paddle/{ => fluid}/framework/scope_test.cc (100%) rename paddle/{ => fluid}/framework/selected_rows.cc (100%) rename paddle/{ => fluid}/framework/selected_rows.h (100%) rename paddle/{ => fluid}/framework/selected_rows_test.cc (100%) rename paddle/{ => fluid}/framework/shape_inference.cc (100%) rename paddle/{ => fluid}/framework/shape_inference.h (100%) rename paddle/{ => fluid}/framework/tensor.cc (100%) rename paddle/{ => fluid}/framework/tensor.h (100%) rename paddle/{ => fluid}/framework/tensor.md (100%) rename paddle/{ => fluid}/framework/tensor_impl.h (100%) rename paddle/{ => fluid}/framework/tensor_test.cc (100%) rename paddle/{ => fluid}/framework/tensor_util.cc (100%) rename paddle/{ => fluid}/framework/tensor_util.cu (100%) rename paddle/{ => fluid}/framework/tensor_util.h (100%) rename paddle/{ => fluid}/framework/tensor_util_test.cc (100%) rename paddle/{ => fluid}/framework/tensor_util_test.cu (100%) rename paddle/{ => fluid}/framework/threadpool.cc (100%) rename paddle/{ => fluid}/framework/threadpool.h (100%) rename paddle/{ => fluid}/framework/threadpool_test.cc (100%) rename paddle/{ => fluid}/framework/type_defs.h (100%) rename paddle/{ => fluid}/framework/var_desc.cc (100%) rename paddle/{ => fluid}/framework/var_desc.h (100%) rename paddle/{ => fluid}/framework/var_type.h (100%) rename paddle/{ => fluid}/framework/var_type_inference.h (100%) rename paddle/{ => fluid}/framework/var_type_inference_test.cc (100%) rename paddle/{ => fluid}/framework/variable.h (100%) rename paddle/{ => fluid}/framework/variable.md (100%) rename paddle/{ => fluid}/framework/variable_test.cc (100%) rename paddle/{ => fluid}/inference/CMakeLists.txt (100%) rename paddle/{ => fluid}/inference/io.cc (100%) rename paddle/{ => fluid}/inference/io.h (100%) rename paddle/{ => fluid}/inference/tests/book/CMakeLists.txt (100%) rename paddle/{ => fluid}/inference/tests/book/test_helper.h (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_fit_a_line.cc (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_image_classification.cc (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_label_semantic_roles.cc (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_recognize_digits.cc (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_recommender_system.cc (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_rnn_encoder_decoder.cc (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_understand_sentiment.cc (100%) rename paddle/{ => fluid}/inference/tests/book/test_inference_word2vec.cc (100%) rename paddle/{ => fluid}/memory/.clang-format (100%) rename paddle/{ => fluid}/memory/CMakeLists.txt (100%) rename paddle/{ => fluid}/memory/README.md (100%) rename paddle/{ => fluid}/memory/detail/CMakeLists.txt (100%) rename paddle/{ => fluid}/memory/detail/buddy_allocator.cc (100%) rename paddle/{ => fluid}/memory/detail/buddy_allocator.h (100%) rename paddle/{ => fluid}/memory/detail/memory_block.cc (100%) rename paddle/{ => fluid}/memory/detail/memory_block.h (100%) rename paddle/{ => fluid}/memory/detail/meta_cache.cc (100%) rename paddle/{ => fluid}/memory/detail/meta_cache.h (100%) rename paddle/{ => fluid}/memory/detail/meta_data.cc (100%) rename paddle/{ => fluid}/memory/detail/meta_data.h (100%) rename paddle/{ => fluid}/memory/detail/system_allocator.cc (100%) rename paddle/{ => fluid}/memory/detail/system_allocator.h (100%) rename paddle/{ => fluid}/memory/detail/system_allocator_test.cc (100%) rename paddle/{ => fluid}/memory/memcpy.cc (100%) rename paddle/{ => fluid}/memory/memcpy.h (100%) rename paddle/{ => fluid}/memory/memory.cc (100%) rename paddle/{ => fluid}/memory/memory.h (100%) rename paddle/{ => fluid}/memory/memory_test.cc (100%) rename paddle/{ => fluid}/operators/.clang-format (100%) rename paddle/{ => fluid}/operators/CMakeLists.txt (100%) rename paddle/{ => fluid}/operators/accuracy_op.cc (100%) rename paddle/{ => fluid}/operators/accuracy_op.cu (100%) rename paddle/{ => fluid}/operators/accuracy_op.h (100%) rename paddle/{ => fluid}/operators/activation_op.cc (100%) rename paddle/{ => fluid}/operators/activation_op.cu (100%) rename paddle/{ => fluid}/operators/activation_op.h (100%) rename paddle/{ => fluid}/operators/adadelta_op.cc (100%) rename paddle/{ => fluid}/operators/adadelta_op.cu (100%) rename paddle/{ => fluid}/operators/adadelta_op.h (100%) rename paddle/{ => fluid}/operators/adagrad_op.cc (100%) rename paddle/{ => fluid}/operators/adagrad_op.cu (100%) rename paddle/{ => fluid}/operators/adagrad_op.h (100%) rename paddle/{ => fluid}/operators/adam_op.cc (100%) rename paddle/{ => fluid}/operators/adam_op.cu (100%) rename paddle/{ => fluid}/operators/adam_op.h (100%) rename paddle/{ => fluid}/operators/adamax_op.cc (100%) rename paddle/{ => fluid}/operators/adamax_op.cu (100%) rename paddle/{ => fluid}/operators/adamax_op.h (100%) rename paddle/{ => fluid}/operators/array_operator.h (100%) rename paddle/{ => fluid}/operators/array_to_lod_tensor_op.cc (100%) rename paddle/{ => fluid}/operators/assign_op.cc (100%) rename paddle/{ => fluid}/operators/assign_value_op.cc (100%) rename paddle/{ => fluid}/operators/assign_value_op.cu.cc (100%) rename paddle/{ => fluid}/operators/assign_value_op.h (100%) rename paddle/{ => fluid}/operators/auc_op.cc (100%) rename paddle/{ => fluid}/operators/auc_op.h (100%) rename paddle/{ => fluid}/operators/batch_norm_op.cc (100%) rename paddle/{ => fluid}/operators/batch_norm_op.cu.cc (100%) rename paddle/{ => fluid}/operators/batch_norm_op.h (100%) rename paddle/{ => fluid}/operators/beam_search_decode_op.cc (100%) rename paddle/{ => fluid}/operators/beam_search_decode_op.h (100%) rename paddle/{ => fluid}/operators/beam_search_decode_op_test.cc (100%) rename paddle/{ => fluid}/operators/beam_search_op.cc (100%) rename paddle/{ => fluid}/operators/beam_search_op.h (100%) rename paddle/{ => fluid}/operators/beam_search_op_test.cc (100%) rename paddle/{ => fluid}/operators/bilinear_tensor_product_op.cc (100%) rename paddle/{ => fluid}/operators/bilinear_tensor_product_op.cu (100%) rename paddle/{ => fluid}/operators/bilinear_tensor_product_op.h (100%) rename paddle/{ => fluid}/operators/bipartite_match_op.cc (100%) rename paddle/{ => fluid}/operators/box_coder_op.cc (100%) rename paddle/{ => fluid}/operators/box_coder_op.cu (100%) rename paddle/{ => fluid}/operators/box_coder_op.h (100%) rename paddle/{ => fluid}/operators/cast_op.cc (100%) rename paddle/{ => fluid}/operators/cast_op.cu (100%) rename paddle/{ => fluid}/operators/cast_op.h (100%) rename paddle/{ => fluid}/operators/chunk_eval_op.cc (100%) rename paddle/{ => fluid}/operators/chunk_eval_op.h (100%) rename paddle/{ => fluid}/operators/clip_by_norm_op.cc (100%) rename paddle/{ => fluid}/operators/clip_by_norm_op.cu (100%) rename paddle/{ => fluid}/operators/clip_by_norm_op.h (100%) rename paddle/{ => fluid}/operators/clip_op.cc (100%) rename paddle/{ => fluid}/operators/clip_op.cu (100%) rename paddle/{ => fluid}/operators/clip_op.h (100%) rename paddle/{ => fluid}/operators/compare_op.cc (100%) rename paddle/{ => fluid}/operators/compare_op.cu (100%) rename paddle/{ => fluid}/operators/compare_op.h (100%) rename paddle/{ => fluid}/operators/concat_op.cc (100%) rename paddle/{ => fluid}/operators/concat_op.cu.cc (100%) rename paddle/{ => fluid}/operators/concat_op.h (100%) rename paddle/{ => fluid}/operators/cond_op.cc (100%) rename paddle/{ => fluid}/operators/cond_op.h (100%) rename paddle/{ => fluid}/operators/conditional_block_op.cc (100%) rename paddle/{ => fluid}/operators/conv_cudnn_op.cu.cc (100%) rename paddle/{ => fluid}/operators/conv_op.cc (100%) rename paddle/{ => fluid}/operators/conv_op.cu.cc (100%) rename paddle/{ => fluid}/operators/conv_op.h (100%) rename paddle/{ => fluid}/operators/conv_shift_op.cc (100%) rename paddle/{ => fluid}/operators/conv_shift_op.cu (100%) rename paddle/{ => fluid}/operators/conv_shift_op.h (100%) rename paddle/{ => fluid}/operators/conv_transpose_cudnn_op.cu.cc (100%) rename paddle/{ => fluid}/operators/conv_transpose_op.cc (100%) rename paddle/{ => fluid}/operators/conv_transpose_op.cu.cc (100%) rename paddle/{ => fluid}/operators/conv_transpose_op.h (100%) rename paddle/{ => fluid}/operators/cos_sim_op.cc (100%) rename paddle/{ => fluid}/operators/cos_sim_op.cu (100%) rename paddle/{ => fluid}/operators/cos_sim_op.h (100%) rename paddle/{ => fluid}/operators/create_reader_op.cc (100%) rename paddle/{ => fluid}/operators/crf_decoding_op.cc (100%) rename paddle/{ => fluid}/operators/crf_decoding_op.h (100%) rename paddle/{ => fluid}/operators/crop_op.cc (100%) rename paddle/{ => fluid}/operators/crop_op.cu (100%) rename paddle/{ => fluid}/operators/crop_op.h (100%) rename paddle/{ => fluid}/operators/cross_entropy_op.cc (100%) rename paddle/{ => fluid}/operators/cross_entropy_op.cu (100%) rename paddle/{ => fluid}/operators/cross_entropy_op.h (100%) rename paddle/{ => fluid}/operators/ctc_align_op.cc (100%) rename paddle/{ => fluid}/operators/ctc_align_op.cu (100%) rename paddle/{ => fluid}/operators/ctc_align_op.h (100%) rename paddle/{ => fluid}/operators/cum_op.h (100%) rename paddle/{ => fluid}/operators/cumsum_op.cc (100%) rename paddle/{ => fluid}/operators/cumsum_op.cu (100%) rename paddle/{ => fluid}/operators/decayed_adagrad_op.cc (100%) rename paddle/{ => fluid}/operators/decayed_adagrad_op.cu (100%) rename paddle/{ => fluid}/operators/decayed_adagrad_op.h (100%) rename paddle/{ => fluid}/operators/detail/CMakeLists.txt (100%) rename paddle/{ => fluid}/operators/detail/grpc_client.cc (100%) rename paddle/{ => fluid}/operators/detail/grpc_client.h (100%) rename paddle/{ => fluid}/operators/detail/grpc_server.cc (100%) rename paddle/{ => fluid}/operators/detail/grpc_server.h (100%) rename paddle/{ => fluid}/operators/detail/safe_ref.h (100%) rename paddle/{ => fluid}/operators/detail/send_recv.proto (100%) rename paddle/{ => fluid}/operators/detail/sendrecvop_utils.cc (100%) rename paddle/{ => fluid}/operators/detail/sendrecvop_utils.h (100%) rename paddle/{ => fluid}/operators/detail/simple_block_queue.h (100%) rename paddle/{ => fluid}/operators/detail/strided_memcpy.h (100%) rename paddle/{ => fluid}/operators/detection_output_op.cc (100%) rename paddle/{ => fluid}/operators/detection_output_op.cu.cc (100%) rename paddle/{ => fluid}/operators/detection_output_op.h (100%) rename paddle/{ => fluid}/operators/dropout_op.cc (100%) rename paddle/{ => fluid}/operators/dropout_op.cu (100%) rename paddle/{ => fluid}/operators/dropout_op.h (100%) rename paddle/{ => fluid}/operators/edit_distance_op.cc (100%) rename paddle/{ => fluid}/operators/edit_distance_op.cu (100%) rename paddle/{ => fluid}/operators/edit_distance_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_add_op.cc (100%) rename paddle/{ => fluid}/operators/elementwise_add_op.cu (100%) rename paddle/{ => fluid}/operators/elementwise_add_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_div_op.cc (100%) rename paddle/{ => fluid}/operators/elementwise_div_op.cu (100%) rename paddle/{ => fluid}/operators/elementwise_div_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_max_op.cc (100%) rename paddle/{ => fluid}/operators/elementwise_max_op.cu (100%) rename paddle/{ => fluid}/operators/elementwise_max_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_min_op.cc (100%) rename paddle/{ => fluid}/operators/elementwise_min_op.cu (100%) rename paddle/{ => fluid}/operators/elementwise_min_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_mul_op.cc (100%) rename paddle/{ => fluid}/operators/elementwise_mul_op.cu (100%) rename paddle/{ => fluid}/operators/elementwise_mul_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_op_function.h (100%) rename paddle/{ => fluid}/operators/elementwise_pow_op.cc (100%) rename paddle/{ => fluid}/operators/elementwise_pow_op.cu (100%) rename paddle/{ => fluid}/operators/elementwise_pow_op.h (100%) rename paddle/{ => fluid}/operators/elementwise_sub_op.cc (100%) rename paddle/{ => fluid}/operators/elementwise_sub_op.cu (100%) rename paddle/{ => fluid}/operators/elementwise_sub_op.h (100%) rename paddle/{ => fluid}/operators/expand_op.cc (100%) rename paddle/{ => fluid}/operators/expand_op.cu (100%) rename paddle/{ => fluid}/operators/expand_op.h (100%) rename paddle/{ => fluid}/operators/feed_op.cc (100%) rename paddle/{ => fluid}/operators/fetch_op.cc (100%) rename paddle/{ => fluid}/operators/fill_constant_batch_size_like_op.cc (100%) rename paddle/{ => fluid}/operators/fill_constant_batch_size_like_op.cu.cc (100%) rename paddle/{ => fluid}/operators/fill_constant_batch_size_like_op.h (100%) rename paddle/{ => fluid}/operators/fill_constant_op.cc (100%) rename paddle/{ => fluid}/operators/fill_op.cc (100%) rename paddle/{ => fluid}/operators/fill_zeros_like_op.cc (100%) rename paddle/{ => fluid}/operators/fill_zeros_like_op.cu.cc (100%) rename paddle/{ => fluid}/operators/fill_zeros_like_op.h (100%) rename paddle/{ => fluid}/operators/ftrl_op.cc (100%) rename paddle/{ => fluid}/operators/ftrl_op.cu (100%) rename paddle/{ => fluid}/operators/ftrl_op.h (100%) rename paddle/{ => fluid}/operators/gather.cu.h (100%) rename paddle/{ => fluid}/operators/gather.h (100%) rename paddle/{ => fluid}/operators/gather_op.cc (100%) rename paddle/{ => fluid}/operators/gather_op.cu (100%) rename paddle/{ => fluid}/operators/gather_op.h (100%) rename paddle/{ => fluid}/operators/gather_test.cc (100%) rename paddle/{ => fluid}/operators/gaussian_random_op.cc (100%) rename paddle/{ => fluid}/operators/gaussian_random_op.cu (100%) rename paddle/{ => fluid}/operators/get_places_op.cc (100%) rename paddle/{ => fluid}/operators/gru_op.cc (100%) rename paddle/{ => fluid}/operators/gru_op.cu.cc (100%) rename paddle/{ => fluid}/operators/gru_op.h (100%) rename paddle/{ => fluid}/operators/gru_unit_op.cc (100%) rename paddle/{ => fluid}/operators/gru_unit_op.cu (100%) rename paddle/{ => fluid}/operators/gru_unit_op.h (100%) rename paddle/{ => fluid}/operators/hinge_loss_op.cc (100%) rename paddle/{ => fluid}/operators/hinge_loss_op.cu (100%) rename paddle/{ => fluid}/operators/hinge_loss_op.h (100%) rename paddle/{ => fluid}/operators/huber_loss_op.cc (100%) rename paddle/{ => fluid}/operators/huber_loss_op.cu (100%) rename paddle/{ => fluid}/operators/huber_loss_op.h (100%) rename paddle/{ => fluid}/operators/im2sequence_op.cc (100%) rename paddle/{ => fluid}/operators/im2sequence_op.cu (100%) rename paddle/{ => fluid}/operators/im2sequence_op.h (100%) rename paddle/{ => fluid}/operators/images/batch_norm_fork.dot (100%) rename paddle/{ => fluid}/operators/images/batch_norm_fork.png (100%) rename paddle/{ => fluid}/operators/images/batch_norm_op_kernel.png (100%) rename paddle/{ => fluid}/operators/increment_op.cc (100%) rename paddle/{ => fluid}/operators/iou_similarity_op.cc (100%) rename paddle/{ => fluid}/operators/iou_similarity_op.cu (100%) rename paddle/{ => fluid}/operators/iou_similarity_op.h (100%) rename paddle/{ => fluid}/operators/is_empty_op.cc (100%) rename paddle/{ => fluid}/operators/l1_norm_op.cc (100%) rename paddle/{ => fluid}/operators/l1_norm_op.cu (100%) rename paddle/{ => fluid}/operators/l1_norm_op.h (100%) rename paddle/{ => fluid}/operators/label_smooth_op.cc (100%) rename paddle/{ => fluid}/operators/label_smooth_op.cu (100%) rename paddle/{ => fluid}/operators/label_smooth_op.h (100%) rename paddle/{ => fluid}/operators/layer_norm_op.cc (100%) rename paddle/{ => fluid}/operators/layer_norm_op.cu (100%) rename paddle/{ => fluid}/operators/layer_norm_op.h (100%) rename paddle/{ => fluid}/operators/linear_chain_crf_op.cc (100%) rename paddle/{ => fluid}/operators/linear_chain_crf_op.cu (100%) rename paddle/{ => fluid}/operators/linear_chain_crf_op.h (100%) rename paddle/{ => fluid}/operators/listen_and_serv_op.cc (100%) rename paddle/{ => fluid}/operators/load_combine_op.cc (100%) rename paddle/{ => fluid}/operators/load_op.cc (100%) rename paddle/{ => fluid}/operators/lod_array_length_op.cc (100%) rename paddle/{ => fluid}/operators/lod_rank_table_op.cc (100%) rename paddle/{ => fluid}/operators/lod_reset_op.cc (100%) rename paddle/{ => fluid}/operators/lod_reset_op.cu (100%) rename paddle/{ => fluid}/operators/lod_reset_op.h (100%) rename paddle/{ => fluid}/operators/lod_tensor_to_array_op.cc (100%) rename paddle/{ => fluid}/operators/log_loss_op.cc (100%) rename paddle/{ => fluid}/operators/log_loss_op.cu (100%) rename paddle/{ => fluid}/operators/log_loss_op.h (100%) rename paddle/{ => fluid}/operators/logical_op.cc (100%) rename paddle/{ => fluid}/operators/logical_op.cu (100%) rename paddle/{ => fluid}/operators/logical_op.h (100%) rename paddle/{ => fluid}/operators/lookup_table_op.cc (100%) rename paddle/{ => fluid}/operators/lookup_table_op.cu (100%) rename paddle/{ => fluid}/operators/lookup_table_op.h (100%) rename paddle/{ => fluid}/operators/lrn_op.cc (100%) rename paddle/{ => fluid}/operators/lrn_op.cu (100%) rename paddle/{ => fluid}/operators/lrn_op.h (100%) rename paddle/{ => fluid}/operators/lstm_op.cc (100%) rename paddle/{ => fluid}/operators/lstm_op.cu.cc (100%) rename paddle/{ => fluid}/operators/lstm_op.h (100%) rename paddle/{ => fluid}/operators/lstm_unit_op.cc (100%) rename paddle/{ => fluid}/operators/lstm_unit_op.cu (100%) rename paddle/{ => fluid}/operators/lstm_unit_op.h (100%) rename paddle/{ => fluid}/operators/lstmp_op.cc (100%) rename paddle/{ => fluid}/operators/lstmp_op.cu (100%) rename paddle/{ => fluid}/operators/lstmp_op.h (100%) rename paddle/{ => fluid}/operators/margin_rank_loss_op.cc (100%) rename paddle/{ => fluid}/operators/margin_rank_loss_op.cu (100%) rename paddle/{ => fluid}/operators/margin_rank_loss_op.h (100%) rename paddle/{ => fluid}/operators/math/CMakeLists.txt (100%) rename paddle/{ => fluid}/operators/math/context_project.cc (100%) rename paddle/{ => fluid}/operators/math/context_project.cu (100%) rename paddle/{ => fluid}/operators/math/context_project.h (100%) rename paddle/{ => fluid}/operators/math/cos_sim_functor.cc (100%) rename paddle/{ => fluid}/operators/math/cos_sim_functor.cu (100%) rename paddle/{ => fluid}/operators/math/cos_sim_functor.h (100%) rename paddle/{ => fluid}/operators/math/cross_entropy.cc (100%) rename paddle/{ => fluid}/operators/math/cross_entropy.cu (100%) rename paddle/{ => fluid}/operators/math/cross_entropy.h (100%) rename paddle/{ => fluid}/operators/math/depthwise_conv.cu (100%) rename paddle/{ => fluid}/operators/math/depthwise_conv.h (100%) rename paddle/{ => fluid}/operators/math/detail/CMakeLists.txt (100%) rename paddle/{ => fluid}/operators/math/detail/activation_functions.h (100%) rename paddle/{ => fluid}/operators/math/detail/avx_functions.cc (100%) rename paddle/{ => fluid}/operators/math/detail/gru_cpu_kernel.h (100%) rename paddle/{ => fluid}/operators/math/detail/gru_gpu_kernel.h (100%) rename paddle/{ => fluid}/operators/math/detail/gru_kernel.h (100%) rename paddle/{ => fluid}/operators/math/detail/lstm_cpu_kernel.h (100%) rename paddle/{ => fluid}/operators/math/detail/lstm_gpu_kernel.h (100%) rename paddle/{ => fluid}/operators/math/detail/lstm_kernel.h (100%) rename paddle/{ => fluid}/operators/math/detection_util.h (100%) rename paddle/{ => fluid}/operators/math/gru_compute.cc (100%) rename paddle/{ => fluid}/operators/math/gru_compute.cu (100%) rename paddle/{ => fluid}/operators/math/gru_compute.h (100%) rename paddle/{ => fluid}/operators/math/im2col.cc (100%) rename paddle/{ => fluid}/operators/math/im2col.cu (100%) rename paddle/{ => fluid}/operators/math/im2col.h (100%) rename paddle/{ => fluid}/operators/math/im2col_test.cc (100%) rename paddle/{ => fluid}/operators/math/lstm_compute.cc (100%) rename paddle/{ => fluid}/operators/math/lstm_compute.cu (100%) rename paddle/{ => fluid}/operators/math/lstm_compute.h (100%) rename paddle/{ => fluid}/operators/math/math_function.cc (100%) rename paddle/{ => fluid}/operators/math/math_function.cu (100%) rename paddle/{ => fluid}/operators/math/math_function.h (100%) rename paddle/{ => fluid}/operators/math/math_function_impl.h (100%) rename paddle/{ => fluid}/operators/math/math_function_test.cc (100%) rename paddle/{ => fluid}/operators/math/math_function_test.cu (100%) rename paddle/{ => fluid}/operators/math/matmul.h (100%) rename paddle/{ => fluid}/operators/math/maxouting.cc (100%) rename paddle/{ => fluid}/operators/math/maxouting.cu (100%) rename paddle/{ => fluid}/operators/math/maxouting.h (100%) rename paddle/{ => fluid}/operators/math/pooling.cc (100%) rename paddle/{ => fluid}/operators/math/pooling.cu (100%) rename paddle/{ => fluid}/operators/math/pooling.h (100%) rename paddle/{ => fluid}/operators/math/sampler.cc (100%) rename paddle/{ => fluid}/operators/math/sampler.h (100%) rename paddle/{ => fluid}/operators/math/selected_rows_functor.cc (100%) rename paddle/{ => fluid}/operators/math/selected_rows_functor.cu (100%) rename paddle/{ => fluid}/operators/math/selected_rows_functor.h (100%) rename paddle/{ => fluid}/operators/math/selected_rows_functor_test.cc (100%) rename paddle/{ => fluid}/operators/math/selected_rows_functor_test.cu (100%) rename paddle/{ => fluid}/operators/math/sequence2batch.cc (100%) rename paddle/{ => fluid}/operators/math/sequence2batch.cu (100%) rename paddle/{ => fluid}/operators/math/sequence2batch.h (100%) rename paddle/{ => fluid}/operators/math/sequence_padding.cc (100%) rename paddle/{ => fluid}/operators/math/sequence_padding.cu (100%) rename paddle/{ => fluid}/operators/math/sequence_padding.h (100%) rename paddle/{ => fluid}/operators/math/sequence_padding_test.cc (100%) rename paddle/{ => fluid}/operators/math/sequence_pooling.cc (100%) rename paddle/{ => fluid}/operators/math/sequence_pooling.cu (100%) rename paddle/{ => fluid}/operators/math/sequence_pooling.h (100%) rename paddle/{ => fluid}/operators/math/sequence_scale.cc (100%) rename paddle/{ => fluid}/operators/math/sequence_scale.cu (100%) rename paddle/{ => fluid}/operators/math/sequence_scale.h (100%) rename paddle/{ => fluid}/operators/math/softmax.cc (100%) rename paddle/{ => fluid}/operators/math/softmax.cu (100%) rename paddle/{ => fluid}/operators/math/softmax.h (100%) rename paddle/{ => fluid}/operators/math/softmax_impl.h (100%) rename paddle/{ => fluid}/operators/math/unpooling.cc (100%) rename paddle/{ => fluid}/operators/math/unpooling.cu (100%) rename paddle/{ => fluid}/operators/math/unpooling.h (100%) rename paddle/{ => fluid}/operators/math/vol2col.cc (100%) rename paddle/{ => fluid}/operators/math/vol2col.cu (100%) rename paddle/{ => fluid}/operators/math/vol2col.h (100%) rename paddle/{ => fluid}/operators/math/vol2col_test.cc (100%) rename paddle/{ => fluid}/operators/matmul_op.cc (100%) rename paddle/{ => fluid}/operators/matmul_op.cu.cc (100%) rename paddle/{ => fluid}/operators/matmul_op.h (100%) rename paddle/{ => fluid}/operators/max_sequence_len_op.cc (100%) rename paddle/{ => fluid}/operators/maxout_op.cc (100%) rename paddle/{ => fluid}/operators/maxout_op.cu.cc (100%) rename paddle/{ => fluid}/operators/maxout_op.h (100%) rename paddle/{ => fluid}/operators/mean_op.cc (100%) rename paddle/{ => fluid}/operators/mean_op.cu (100%) rename paddle/{ => fluid}/operators/mean_op.h (100%) rename paddle/{ => fluid}/operators/merge_lod_tensor_op.cc (100%) rename paddle/{ => fluid}/operators/mine_hard_examples_op.cc (100%) rename paddle/{ => fluid}/operators/minus_op.cc (100%) rename paddle/{ => fluid}/operators/minus_op.cu (100%) rename paddle/{ => fluid}/operators/minus_op.h (100%) rename paddle/{ => fluid}/operators/modified_huber_loss_op.cc (100%) rename paddle/{ => fluid}/operators/modified_huber_loss_op.cu (100%) rename paddle/{ => fluid}/operators/modified_huber_loss_op.h (100%) rename paddle/{ => fluid}/operators/momentum_op.cc (100%) rename paddle/{ => fluid}/operators/momentum_op.cu (100%) rename paddle/{ => fluid}/operators/momentum_op.h (100%) rename paddle/{ => fluid}/operators/mul_op.cc (100%) rename paddle/{ => fluid}/operators/mul_op.cu.cc (100%) rename paddle/{ => fluid}/operators/mul_op.h (100%) rename paddle/{ => fluid}/operators/multiclass_nms_op.cc (100%) rename paddle/{ => fluid}/operators/multiplex_op.cc (100%) rename paddle/{ => fluid}/operators/multiplex_op.cu (100%) rename paddle/{ => fluid}/operators/multiplex_op.h (100%) rename paddle/{ => fluid}/operators/nccl/CMakeLists.txt (100%) rename paddle/{ => fluid}/operators/nccl/nccl_gpu_common.cc (100%) rename paddle/{ => fluid}/operators/nccl/nccl_gpu_common.h (100%) rename paddle/{ => fluid}/operators/nccl_op.cc (100%) rename paddle/{ => fluid}/operators/nccl_op.cu.cc (100%) rename paddle/{ => fluid}/operators/nccl_op_test.cu.cc (100%) rename paddle/{ => fluid}/operators/nce_op.cc (100%) rename paddle/{ => fluid}/operators/nce_op.h (100%) rename paddle/{ => fluid}/operators/net_op.cc (100%) rename paddle/{ => fluid}/operators/net_op.h (100%) rename paddle/{ => fluid}/operators/net_op_test.cc (100%) rename paddle/{ => fluid}/operators/norm_op.cc (100%) rename paddle/{ => fluid}/operators/norm_op.cu (100%) rename paddle/{ => fluid}/operators/norm_op.h (100%) rename paddle/{ => fluid}/operators/one_hot_op.cc (100%) rename paddle/{ => fluid}/operators/one_hot_op.cu (100%) rename paddle/{ => fluid}/operators/one_hot_op.h (100%) rename paddle/{ => fluid}/operators/op_documentation/batch_norm_op.md (100%) rename paddle/{ => fluid}/operators/op_documentation/name_convention.md (100%) rename paddle/{ => fluid}/operators/op_documentation/net_op_design.md (100%) rename paddle/{ => fluid}/operators/op_documentation/op_markdown_format.md (100%) rename paddle/{ => fluid}/operators/op_documentation/rnn_design.md (100%) rename paddle/{ => fluid}/operators/pad_op.cc (100%) rename paddle/{ => fluid}/operators/pad_op.cu (100%) rename paddle/{ => fluid}/operators/pad_op.h (100%) rename paddle/{ => fluid}/operators/parallel_do_op.cc (100%) rename paddle/{ => fluid}/operators/pool_cudnn_op.cu.cc (100%) rename paddle/{ => fluid}/operators/pool_op.cc (100%) rename paddle/{ => fluid}/operators/pool_op.cu.cc (100%) rename paddle/{ => fluid}/operators/pool_op.h (100%) rename paddle/{ => fluid}/operators/pool_with_index_op.cc (100%) rename paddle/{ => fluid}/operators/pool_with_index_op.cu.cc (100%) rename paddle/{ => fluid}/operators/pool_with_index_op.h (100%) rename paddle/{ => fluid}/operators/positive_negative_pair_op.cc (100%) rename paddle/{ => fluid}/operators/positive_negative_pair_op.h (100%) rename paddle/{ => fluid}/operators/precision_recall_op.cc (100%) rename paddle/{ => fluid}/operators/precision_recall_op.h (100%) rename paddle/{ => fluid}/operators/prelu_op.cc (100%) rename paddle/{ => fluid}/operators/prelu_op.cu (100%) rename paddle/{ => fluid}/operators/prelu_op.h (100%) rename paddle/{ => fluid}/operators/print_op.cc (100%) rename paddle/{ => fluid}/operators/prior_box_op.cc (100%) rename paddle/{ => fluid}/operators/prior_box_op.h (100%) rename paddle/{ => fluid}/operators/proximal_adagrad_op.cc (100%) rename paddle/{ => fluid}/operators/proximal_adagrad_op.cu (100%) rename paddle/{ => fluid}/operators/proximal_adagrad_op.h (100%) rename paddle/{ => fluid}/operators/proximal_gd_op.cc (100%) rename paddle/{ => fluid}/operators/proximal_gd_op.cu (100%) rename paddle/{ => fluid}/operators/proximal_gd_op.h (100%) rename paddle/{ => fluid}/operators/rank_loss_op.cc (100%) rename paddle/{ => fluid}/operators/rank_loss_op.cu (100%) rename paddle/{ => fluid}/operators/rank_loss_op.h (100%) rename paddle/{ => fluid}/operators/read_op.cc (100%) rename paddle/{ => fluid}/operators/recurrent_op.cc (100%) rename paddle/{ => fluid}/operators/recv_op.cc (100%) rename paddle/{ => fluid}/operators/reduce_op.cc (100%) rename paddle/{ => fluid}/operators/reduce_op.cu (100%) rename paddle/{ => fluid}/operators/reduce_op.h (100%) rename paddle/{ => fluid}/operators/reorder_lod_tensor_by_rank_op.cc (100%) rename paddle/{ => fluid}/operators/reshape_op.cc (100%) rename paddle/{ => fluid}/operators/reshape_op.cu (100%) rename paddle/{ => fluid}/operators/reshape_op.h (100%) rename paddle/{ => fluid}/operators/rmsprop_op.cc (100%) rename paddle/{ => fluid}/operators/rmsprop_op.cu (100%) rename paddle/{ => fluid}/operators/rmsprop_op.h (100%) rename paddle/{ => fluid}/operators/rnn_memory_helper_op.cc (100%) rename paddle/{ => fluid}/operators/roi_pool_op.cc (100%) rename paddle/{ => fluid}/operators/roi_pool_op.cu (100%) rename paddle/{ => fluid}/operators/roi_pool_op.h (100%) rename paddle/{ => fluid}/operators/row_conv_op.cc (100%) rename paddle/{ => fluid}/operators/row_conv_op.cu (100%) rename paddle/{ => fluid}/operators/row_conv_op.h (100%) rename paddle/{ => fluid}/operators/save_combine_op.cc (100%) rename paddle/{ => fluid}/operators/save_load_combine_op_test.cc (100%) rename paddle/{ => fluid}/operators/save_load_op_test.cc (100%) rename paddle/{ => fluid}/operators/save_op.cc (100%) rename paddle/{ => fluid}/operators/scale_op.cc (100%) rename paddle/{ => fluid}/operators/scale_op.cu (100%) rename paddle/{ => fluid}/operators/scale_op.h (100%) rename paddle/{ => fluid}/operators/scatter.cu.h (100%) rename paddle/{ => fluid}/operators/scatter.h (100%) rename paddle/{ => fluid}/operators/scatter_op.cc (100%) rename paddle/{ => fluid}/operators/scatter_op.cu (100%) rename paddle/{ => fluid}/operators/scatter_op.h (100%) rename paddle/{ => fluid}/operators/scatter_test.cc (100%) rename paddle/{ => fluid}/operators/send_op.cc (100%) rename paddle/{ => fluid}/operators/send_recv_op_test.cc (100%) rename paddle/{ => fluid}/operators/sequence_concat_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_concat_op.cu.cc (100%) rename paddle/{ => fluid}/operators/sequence_concat_op.h (100%) rename paddle/{ => fluid}/operators/sequence_conv_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_conv_op.cu.cc (100%) rename paddle/{ => fluid}/operators/sequence_conv_op.h (100%) rename paddle/{ => fluid}/operators/sequence_erase_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_erase_op.cu (100%) rename paddle/{ => fluid}/operators/sequence_erase_op.h (100%) rename paddle/{ => fluid}/operators/sequence_expand_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_expand_op.cu (100%) rename paddle/{ => fluid}/operators/sequence_expand_op.h (100%) rename paddle/{ => fluid}/operators/sequence_pool_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_pool_op.cu (100%) rename paddle/{ => fluid}/operators/sequence_pool_op.h (100%) rename paddle/{ => fluid}/operators/sequence_reshape_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_reshape_op.cu (100%) rename paddle/{ => fluid}/operators/sequence_reshape_op.h (100%) rename paddle/{ => fluid}/operators/sequence_slice_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_slice_op.cu (100%) rename paddle/{ => fluid}/operators/sequence_slice_op.h (100%) rename paddle/{ => fluid}/operators/sequence_softmax_op.cc (100%) rename paddle/{ => fluid}/operators/sequence_softmax_op.cu.cc (100%) rename paddle/{ => fluid}/operators/sequence_softmax_op.h (100%) rename paddle/{ => fluid}/operators/sgd_op.cc (100%) rename paddle/{ => fluid}/operators/sgd_op.cu (100%) rename paddle/{ => fluid}/operators/sgd_op.h (100%) rename paddle/{ => fluid}/operators/shrink_rnn_memory_op.cc (100%) rename paddle/{ => fluid}/operators/sigmoid_cross_entropy_with_logits_op.cc (100%) rename paddle/{ => fluid}/operators/sigmoid_cross_entropy_with_logits_op.cu (100%) rename paddle/{ => fluid}/operators/sigmoid_cross_entropy_with_logits_op.h (100%) rename paddle/{ => fluid}/operators/sign_op.cc (100%) rename paddle/{ => fluid}/operators/sign_op.cu (100%) rename paddle/{ => fluid}/operators/sign_op.h (100%) rename paddle/{ => fluid}/operators/smooth_l1_loss_op.cc (100%) rename paddle/{ => fluid}/operators/smooth_l1_loss_op.cu (100%) rename paddle/{ => fluid}/operators/smooth_l1_loss_op.h (100%) rename paddle/{ => fluid}/operators/softmax_op.cc (100%) rename paddle/{ => fluid}/operators/softmax_op.cu.cc (100%) rename paddle/{ => fluid}/operators/softmax_op.h (100%) rename paddle/{ => fluid}/operators/softmax_with_cross_entropy_op.cc (100%) rename paddle/{ => fluid}/operators/softmax_with_cross_entropy_op.cu (100%) rename paddle/{ => fluid}/operators/softmax_with_cross_entropy_op.h (100%) rename paddle/{ => fluid}/operators/split_lod_tensor_op.cc (100%) rename paddle/{ => fluid}/operators/split_op.cc (100%) rename paddle/{ => fluid}/operators/split_op.cu.cc (100%) rename paddle/{ => fluid}/operators/split_op.h (100%) rename paddle/{ => fluid}/operators/split_selected_rows_op.cc (100%) rename paddle/{ => fluid}/operators/split_selected_rows_op.cu (100%) rename paddle/{ => fluid}/operators/split_selected_rows_op.h (100%) rename paddle/{ => fluid}/operators/spp_op.cc (100%) rename paddle/{ => fluid}/operators/spp_op.cu.cc (100%) rename paddle/{ => fluid}/operators/spp_op.h (100%) rename paddle/{ => fluid}/operators/squared_l2_distance_op.cc (100%) rename paddle/{ => fluid}/operators/squared_l2_distance_op.cu (100%) rename paddle/{ => fluid}/operators/squared_l2_distance_op.h (100%) rename paddle/{ => fluid}/operators/squared_l2_norm_op.cc (100%) rename paddle/{ => fluid}/operators/squared_l2_norm_op.cu (100%) rename paddle/{ => fluid}/operators/squared_l2_norm_op.h (100%) rename paddle/{ => fluid}/operators/strided_memcpy.h (100%) rename paddle/{ => fluid}/operators/strided_memcpy_test.cc (100%) rename paddle/{ => fluid}/operators/sum_op.cc (100%) rename paddle/{ => fluid}/operators/sum_op.cu (100%) rename paddle/{ => fluid}/operators/sum_op.h (100%) rename paddle/{ => fluid}/operators/target_assign_op.cc (100%) rename paddle/{ => fluid}/operators/target_assign_op.cu (100%) rename paddle/{ => fluid}/operators/target_assign_op.h (100%) rename paddle/{ => fluid}/operators/tensor_array_read_write_op.cc (100%) rename paddle/{ => fluid}/operators/top_k_op.cc (100%) rename paddle/{ => fluid}/operators/top_k_op.cu (100%) rename paddle/{ => fluid}/operators/top_k_op.h (100%) rename paddle/{ => fluid}/operators/transpose_op.cc (100%) rename paddle/{ => fluid}/operators/transpose_op.cu.cc (100%) rename paddle/{ => fluid}/operators/transpose_op.h (100%) rename paddle/{ => fluid}/operators/uniform_random_op.cc (100%) rename paddle/{ => fluid}/operators/uniform_random_op.cu (100%) rename paddle/{ => fluid}/operators/unpool_op.cc (100%) rename paddle/{ => fluid}/operators/unpool_op.cu.cc (100%) rename paddle/{ => fluid}/operators/unpool_op.h (100%) rename paddle/{ => fluid}/operators/warpctc_op.cc (100%) rename paddle/{ => fluid}/operators/warpctc_op.cu.cc (100%) rename paddle/{ => fluid}/operators/warpctc_op.h (100%) rename paddle/{ => fluid}/operators/while_op.cc (100%) rename paddle/{ => fluid}/platform/.clang-format (100%) rename paddle/{ => fluid}/platform/CMakeLists.txt (100%) rename paddle/{ => fluid}/platform/assert.h (100%) rename paddle/{ => fluid}/platform/call_once.h (100%) rename paddle/{ => fluid}/platform/cpu_info.cc (100%) rename paddle/{ => fluid}/platform/cpu_info.h (100%) rename paddle/{ => fluid}/platform/cpu_info_test.cc (100%) rename paddle/{ => fluid}/platform/cuda_helper.h (100%) rename paddle/{ => fluid}/platform/cuda_profiler.h (100%) rename paddle/{ => fluid}/platform/cudnn_helper.h (100%) rename paddle/{ => fluid}/platform/cudnn_helper_test.cc (100%) rename paddle/{ => fluid}/platform/details/device_ptr_cast.h (100%) rename paddle/{ => fluid}/platform/device_context.cc (100%) rename paddle/{ => fluid}/platform/device_context.h (100%) rename paddle/{ => fluid}/platform/device_context_test.cu (100%) rename paddle/{ => fluid}/platform/dynload/CMakeLists.txt (100%) rename paddle/{ => fluid}/platform/dynload/cublas.cc (100%) rename paddle/{ => fluid}/platform/dynload/cublas.h (100%) rename paddle/{ => fluid}/platform/dynload/cudnn.cc (100%) rename paddle/{ => fluid}/platform/dynload/cudnn.h (100%) rename paddle/{ => fluid}/platform/dynload/curand.cc (100%) rename paddle/{ => fluid}/platform/dynload/curand.h (100%) rename paddle/{ => fluid}/platform/dynload/dynamic_loader.cc (100%) rename paddle/{ => fluid}/platform/dynload/dynamic_loader.h (100%) rename paddle/{ => fluid}/platform/dynload/nccl.cc (100%) rename paddle/{ => fluid}/platform/dynload/nccl.h (100%) rename paddle/{ => fluid}/platform/dynload/warpctc.cc (100%) rename paddle/{ => fluid}/platform/dynload/warpctc.h (100%) rename paddle/{ => fluid}/platform/enforce.cc (100%) rename paddle/{ => fluid}/platform/enforce.h (100%) rename paddle/{ => fluid}/platform/enforce_test.cc (100%) rename paddle/{ => fluid}/platform/for_range.h (100%) rename paddle/{ => fluid}/platform/gpu_info.cc (100%) rename paddle/{ => fluid}/platform/gpu_info.h (100%) rename paddle/{ => fluid}/platform/hostdevice.h (100%) rename paddle/{ => fluid}/platform/macros.h (100%) rename paddle/{ => fluid}/platform/mkldnn_helper.h (100%) rename paddle/{ => fluid}/platform/nccl_test.cu (100%) rename paddle/{ => fluid}/platform/place.cc (100%) rename paddle/{ => fluid}/platform/place.h (100%) rename paddle/{ => fluid}/platform/place_test.cc (100%) rename paddle/{ => fluid}/platform/profiler.cc (100%) rename paddle/{ => fluid}/platform/profiler.h (100%) rename paddle/{ => fluid}/platform/profiler_test.cc (100%) rename paddle/{ => fluid}/platform/transform.h (100%) rename paddle/{ => fluid}/platform/transform_test.cu (100%) rename paddle/{ => fluid}/platform/variant.h (100%) rename paddle/{ => fluid}/pybind/.clang-format (100%) rename paddle/{ => fluid}/pybind/CMakeLists.txt (100%) rename paddle/{ => fluid}/pybind/const_value.cc (100%) rename paddle/{ => fluid}/pybind/const_value.h (100%) rename paddle/{ => fluid}/pybind/exception.cc (100%) rename paddle/{ => fluid}/pybind/exception.h (100%) rename paddle/{ => fluid}/pybind/protobuf.cc (100%) rename paddle/{ => fluid}/pybind/protobuf.h (100%) rename paddle/{ => fluid}/pybind/pybind.cc (100%) rename paddle/{ => fluid}/pybind/tensor_py.h (100%) diff --git a/paddle/CMakeLists.txt b/paddle/CMakeLists.txt index 3f9c132ef6a..c7deba2ab47 100644 --- a/paddle/CMakeLists.txt +++ b/paddle/CMakeLists.txt @@ -19,12 +19,7 @@ else() endif() if(NOT ANDROID AND NOT IOS) - add_subdirectory(memory) - add_subdirectory(platform) - add_subdirectory(framework) - add_subdirectory(operators) - add_subdirectory(pybind) - add_subdirectory(inference) + add_subdirectory(fluid) endif() if(WITH_SWIG_PY) diff --git a/paddle/fluid/CMakeLists.txt b/paddle/fluid/CMakeLists.txt new file mode 100644 index 00000000000..a6b4191518c --- /dev/null +++ b/paddle/fluid/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(memory) +add_subdirectory(platform) +add_subdirectory(framework) +add_subdirectory(operators) +add_subdirectory(pybind) +add_subdirectory(inference) diff --git a/paddle/framework/.clang-format b/paddle/fluid/framework/.clang-format similarity index 100% rename from paddle/framework/.clang-format rename to paddle/fluid/framework/.clang-format diff --git a/paddle/framework/CMakeLists.txt b/paddle/fluid/framework/CMakeLists.txt similarity index 100% rename from paddle/framework/CMakeLists.txt rename to paddle/fluid/framework/CMakeLists.txt diff --git a/paddle/framework/attribute.cc b/paddle/fluid/framework/attribute.cc similarity index 100% rename from paddle/framework/attribute.cc rename to paddle/fluid/framework/attribute.cc diff --git a/paddle/framework/attribute.h b/paddle/fluid/framework/attribute.h similarity index 100% rename from paddle/framework/attribute.h rename to paddle/fluid/framework/attribute.h diff --git a/paddle/framework/backward.cc b/paddle/fluid/framework/backward.cc similarity index 100% rename from paddle/framework/backward.cc rename to paddle/fluid/framework/backward.cc diff --git a/paddle/framework/backward.h b/paddle/fluid/framework/backward.h similarity index 100% rename from paddle/framework/backward.h rename to paddle/fluid/framework/backward.h diff --git a/paddle/framework/backward_test.cc b/paddle/fluid/framework/backward_test.cc similarity index 100% rename from paddle/framework/backward_test.cc rename to paddle/fluid/framework/backward_test.cc diff --git a/paddle/framework/block_desc.cc b/paddle/fluid/framework/block_desc.cc similarity index 100% rename from paddle/framework/block_desc.cc rename to paddle/fluid/framework/block_desc.cc diff --git a/paddle/framework/block_desc.h b/paddle/fluid/framework/block_desc.h similarity index 100% rename from paddle/framework/block_desc.h rename to paddle/fluid/framework/block_desc.h diff --git a/paddle/framework/channel.h b/paddle/fluid/framework/channel.h similarity index 100% rename from paddle/framework/channel.h rename to paddle/fluid/framework/channel.h diff --git a/paddle/framework/channel_test.cc b/paddle/fluid/framework/channel_test.cc similarity index 100% rename from paddle/framework/channel_test.cc rename to paddle/fluid/framework/channel_test.cc diff --git a/paddle/framework/data_device_transform.cc b/paddle/fluid/framework/data_device_transform.cc similarity index 100% rename from paddle/framework/data_device_transform.cc rename to paddle/fluid/framework/data_device_transform.cc diff --git a/paddle/framework/data_device_transform.h b/paddle/fluid/framework/data_device_transform.h similarity index 100% rename from paddle/framework/data_device_transform.h rename to paddle/fluid/framework/data_device_transform.h diff --git a/paddle/framework/data_device_transform_test.cu b/paddle/fluid/framework/data_device_transform_test.cu similarity index 100% rename from paddle/framework/data_device_transform_test.cu rename to paddle/fluid/framework/data_device_transform_test.cu diff --git a/paddle/framework/data_layout.h b/paddle/fluid/framework/data_layout.h similarity index 100% rename from paddle/framework/data_layout.h rename to paddle/fluid/framework/data_layout.h diff --git a/paddle/framework/data_layout_transform.cc b/paddle/fluid/framework/data_layout_transform.cc similarity index 100% rename from paddle/framework/data_layout_transform.cc rename to paddle/fluid/framework/data_layout_transform.cc diff --git a/paddle/framework/data_layout_transform.h b/paddle/fluid/framework/data_layout_transform.h similarity index 100% rename from paddle/framework/data_layout_transform.h rename to paddle/fluid/framework/data_layout_transform.h diff --git a/paddle/framework/data_layout_transform_test.cc b/paddle/fluid/framework/data_layout_transform_test.cc similarity index 100% rename from paddle/framework/data_layout_transform_test.cc rename to paddle/fluid/framework/data_layout_transform_test.cc diff --git a/paddle/framework/data_transform.cc b/paddle/fluid/framework/data_transform.cc similarity index 100% rename from paddle/framework/data_transform.cc rename to paddle/fluid/framework/data_transform.cc diff --git a/paddle/framework/data_transform.h b/paddle/fluid/framework/data_transform.h similarity index 100% rename from paddle/framework/data_transform.h rename to paddle/fluid/framework/data_transform.h diff --git a/paddle/framework/data_type.h b/paddle/fluid/framework/data_type.h similarity index 100% rename from paddle/framework/data_type.h rename to paddle/fluid/framework/data_type.h diff --git a/paddle/framework/data_type_transform.cc b/paddle/fluid/framework/data_type_transform.cc similarity index 100% rename from paddle/framework/data_type_transform.cc rename to paddle/fluid/framework/data_type_transform.cc diff --git a/paddle/framework/data_type_transform.h b/paddle/fluid/framework/data_type_transform.h similarity index 100% rename from paddle/framework/data_type_transform.h rename to paddle/fluid/framework/data_type_transform.h diff --git a/paddle/framework/data_type_transform_test.cc b/paddle/fluid/framework/data_type_transform_test.cc similarity index 100% rename from paddle/framework/data_type_transform_test.cc rename to paddle/fluid/framework/data_type_transform_test.cc diff --git a/paddle/framework/ddim.cc b/paddle/fluid/framework/ddim.cc similarity index 100% rename from paddle/framework/ddim.cc rename to paddle/fluid/framework/ddim.cc diff --git a/paddle/framework/ddim.h b/paddle/fluid/framework/ddim.h similarity index 100% rename from paddle/framework/ddim.h rename to paddle/fluid/framework/ddim.h diff --git a/paddle/framework/ddim_test.cc b/paddle/fluid/framework/ddim_test.cc similarity index 100% rename from paddle/framework/ddim_test.cc rename to paddle/fluid/framework/ddim_test.cc diff --git a/paddle/framework/details/buffered_channel.h b/paddle/fluid/framework/details/buffered_channel.h similarity index 100% rename from paddle/framework/details/buffered_channel.h rename to paddle/fluid/framework/details/buffered_channel.h diff --git a/paddle/framework/details/cow_ptr.h b/paddle/fluid/framework/details/cow_ptr.h similarity index 100% rename from paddle/framework/details/cow_ptr.h rename to paddle/fluid/framework/details/cow_ptr.h diff --git a/paddle/framework/details/cow_ptr_test.cc b/paddle/fluid/framework/details/cow_ptr_test.cc similarity index 100% rename from paddle/framework/details/cow_ptr_test.cc rename to paddle/fluid/framework/details/cow_ptr_test.cc diff --git a/paddle/framework/details/op_registry.h b/paddle/fluid/framework/details/op_registry.h similarity index 100% rename from paddle/framework/details/op_registry.h rename to paddle/fluid/framework/details/op_registry.h diff --git a/paddle/framework/details/unbuffered_channel.h b/paddle/fluid/framework/details/unbuffered_channel.h similarity index 100% rename from paddle/framework/details/unbuffered_channel.h rename to paddle/fluid/framework/details/unbuffered_channel.h diff --git a/paddle/framework/dim.h b/paddle/fluid/framework/dim.h similarity index 100% rename from paddle/framework/dim.h rename to paddle/fluid/framework/dim.h diff --git a/paddle/framework/dim_test.cu b/paddle/fluid/framework/dim_test.cu similarity index 100% rename from paddle/framework/dim_test.cu rename to paddle/fluid/framework/dim_test.cu diff --git a/paddle/framework/eigen.h b/paddle/fluid/framework/eigen.h similarity index 100% rename from paddle/framework/eigen.h rename to paddle/fluid/framework/eigen.h diff --git a/paddle/framework/eigen_test.cc b/paddle/fluid/framework/eigen_test.cc similarity index 100% rename from paddle/framework/eigen_test.cc rename to paddle/fluid/framework/eigen_test.cc diff --git a/paddle/framework/executor.cc b/paddle/fluid/framework/executor.cc similarity index 100% rename from paddle/framework/executor.cc rename to paddle/fluid/framework/executor.cc diff --git a/paddle/framework/executor.h b/paddle/fluid/framework/executor.h similarity index 100% rename from paddle/framework/executor.h rename to paddle/fluid/framework/executor.h diff --git a/paddle/framework/feed_fetch_method.cc b/paddle/fluid/framework/feed_fetch_method.cc similarity index 100% rename from paddle/framework/feed_fetch_method.cc rename to paddle/fluid/framework/feed_fetch_method.cc diff --git a/paddle/framework/feed_fetch_method.h b/paddle/fluid/framework/feed_fetch_method.h similarity index 100% rename from paddle/framework/feed_fetch_method.h rename to paddle/fluid/framework/feed_fetch_method.h diff --git a/paddle/framework/feed_fetch_type.h b/paddle/fluid/framework/feed_fetch_type.h similarity index 100% rename from paddle/framework/feed_fetch_type.h rename to paddle/fluid/framework/feed_fetch_type.h diff --git a/paddle/framework/framework.proto b/paddle/fluid/framework/framework.proto similarity index 100% rename from paddle/framework/framework.proto rename to paddle/fluid/framework/framework.proto diff --git a/paddle/framework/grad_op_desc_maker.h b/paddle/fluid/framework/grad_op_desc_maker.h similarity index 100% rename from paddle/framework/grad_op_desc_maker.h rename to paddle/fluid/framework/grad_op_desc_maker.h diff --git a/paddle/framework/init.cc b/paddle/fluid/framework/init.cc similarity index 100% rename from paddle/framework/init.cc rename to paddle/fluid/framework/init.cc diff --git a/paddle/framework/init.h b/paddle/fluid/framework/init.h similarity index 100% rename from paddle/framework/init.h rename to paddle/fluid/framework/init.h diff --git a/paddle/framework/init_test.cc b/paddle/fluid/framework/init_test.cc similarity index 100% rename from paddle/framework/init_test.cc rename to paddle/fluid/framework/init_test.cc diff --git a/paddle/framework/library_type.h b/paddle/fluid/framework/library_type.h similarity index 100% rename from paddle/framework/library_type.h rename to paddle/fluid/framework/library_type.h diff --git a/paddle/framework/lod_rank_table.cc b/paddle/fluid/framework/lod_rank_table.cc similarity index 100% rename from paddle/framework/lod_rank_table.cc rename to paddle/fluid/framework/lod_rank_table.cc diff --git a/paddle/framework/lod_rank_table.h b/paddle/fluid/framework/lod_rank_table.h similarity index 100% rename from paddle/framework/lod_rank_table.h rename to paddle/fluid/framework/lod_rank_table.h diff --git a/paddle/framework/lod_tensor.cc b/paddle/fluid/framework/lod_tensor.cc similarity index 100% rename from paddle/framework/lod_tensor.cc rename to paddle/fluid/framework/lod_tensor.cc diff --git a/paddle/framework/lod_tensor.h b/paddle/fluid/framework/lod_tensor.h similarity index 100% rename from paddle/framework/lod_tensor.h rename to paddle/fluid/framework/lod_tensor.h diff --git a/paddle/framework/lod_tensor.md b/paddle/fluid/framework/lod_tensor.md similarity index 100% rename from paddle/framework/lod_tensor.md rename to paddle/fluid/framework/lod_tensor.md diff --git a/paddle/framework/lod_tensor_array.h b/paddle/fluid/framework/lod_tensor_array.h similarity index 100% rename from paddle/framework/lod_tensor_array.h rename to paddle/fluid/framework/lod_tensor_array.h diff --git a/paddle/framework/lod_tensor_test.cc b/paddle/fluid/framework/lod_tensor_test.cc similarity index 100% rename from paddle/framework/lod_tensor_test.cc rename to paddle/fluid/framework/lod_tensor_test.cc diff --git a/paddle/framework/lod_tensor_test.cu b/paddle/fluid/framework/lod_tensor_test.cu similarity index 100% rename from paddle/framework/lod_tensor_test.cu rename to paddle/fluid/framework/lod_tensor_test.cu diff --git a/paddle/framework/mixed_vector.h b/paddle/fluid/framework/mixed_vector.h similarity index 100% rename from paddle/framework/mixed_vector.h rename to paddle/fluid/framework/mixed_vector.h diff --git a/paddle/framework/mixed_vector_test.cu b/paddle/fluid/framework/mixed_vector_test.cu similarity index 100% rename from paddle/framework/mixed_vector_test.cu rename to paddle/fluid/framework/mixed_vector_test.cu diff --git a/paddle/framework/op_desc.cc b/paddle/fluid/framework/op_desc.cc similarity index 100% rename from paddle/framework/op_desc.cc rename to paddle/fluid/framework/op_desc.cc diff --git a/paddle/framework/op_desc.h b/paddle/fluid/framework/op_desc.h similarity index 100% rename from paddle/framework/op_desc.h rename to paddle/fluid/framework/op_desc.h diff --git a/paddle/framework/op_info.cc b/paddle/fluid/framework/op_info.cc similarity index 100% rename from paddle/framework/op_info.cc rename to paddle/fluid/framework/op_info.cc diff --git a/paddle/framework/op_info.h b/paddle/fluid/framework/op_info.h similarity index 100% rename from paddle/framework/op_info.h rename to paddle/fluid/framework/op_info.h diff --git a/paddle/framework/op_kernel_type.h b/paddle/fluid/framework/op_kernel_type.h similarity index 100% rename from paddle/framework/op_kernel_type.h rename to paddle/fluid/framework/op_kernel_type.h diff --git a/paddle/framework/op_kernel_type_test.cc b/paddle/fluid/framework/op_kernel_type_test.cc similarity index 100% rename from paddle/framework/op_kernel_type_test.cc rename to paddle/fluid/framework/op_kernel_type_test.cc diff --git a/paddle/framework/op_proto_maker.cc b/paddle/fluid/framework/op_proto_maker.cc similarity index 100% rename from paddle/framework/op_proto_maker.cc rename to paddle/fluid/framework/op_proto_maker.cc diff --git a/paddle/framework/op_proto_maker.h b/paddle/fluid/framework/op_proto_maker.h similarity index 100% rename from paddle/framework/op_proto_maker.h rename to paddle/fluid/framework/op_proto_maker.h diff --git a/paddle/framework/op_proto_maker_test.cc b/paddle/fluid/framework/op_proto_maker_test.cc similarity index 100% rename from paddle/framework/op_proto_maker_test.cc rename to paddle/fluid/framework/op_proto_maker_test.cc diff --git a/paddle/framework/op_registry.cc b/paddle/fluid/framework/op_registry.cc similarity index 100% rename from paddle/framework/op_registry.cc rename to paddle/fluid/framework/op_registry.cc diff --git a/paddle/framework/op_registry.h b/paddle/fluid/framework/op_registry.h similarity index 100% rename from paddle/framework/op_registry.h rename to paddle/fluid/framework/op_registry.h diff --git a/paddle/framework/op_registry_test.cc b/paddle/fluid/framework/op_registry_test.cc similarity index 100% rename from paddle/framework/op_registry_test.cc rename to paddle/fluid/framework/op_registry_test.cc diff --git a/paddle/framework/operator.cc b/paddle/fluid/framework/operator.cc similarity index 100% rename from paddle/framework/operator.cc rename to paddle/fluid/framework/operator.cc diff --git a/paddle/framework/operator.h b/paddle/fluid/framework/operator.h similarity index 100% rename from paddle/framework/operator.h rename to paddle/fluid/framework/operator.h diff --git a/paddle/framework/operator_test.cc b/paddle/fluid/framework/operator_test.cc similarity index 100% rename from paddle/framework/operator_test.cc rename to paddle/fluid/framework/operator_test.cc diff --git a/paddle/framework/program_desc.cc b/paddle/fluid/framework/program_desc.cc similarity index 100% rename from paddle/framework/program_desc.cc rename to paddle/fluid/framework/program_desc.cc diff --git a/paddle/framework/program_desc.h b/paddle/fluid/framework/program_desc.h similarity index 100% rename from paddle/framework/program_desc.h rename to paddle/fluid/framework/program_desc.h diff --git a/paddle/framework/program_desc_test.cc b/paddle/fluid/framework/program_desc_test.cc similarity index 100% rename from paddle/framework/program_desc_test.cc rename to paddle/fluid/framework/program_desc_test.cc diff --git a/paddle/framework/proto_desc.h b/paddle/fluid/framework/proto_desc.h similarity index 100% rename from paddle/framework/proto_desc.h rename to paddle/fluid/framework/proto_desc.h diff --git a/paddle/framework/prune.cc b/paddle/fluid/framework/prune.cc similarity index 100% rename from paddle/framework/prune.cc rename to paddle/fluid/framework/prune.cc diff --git a/paddle/framework/prune.h b/paddle/fluid/framework/prune.h similarity index 100% rename from paddle/framework/prune.h rename to paddle/fluid/framework/prune.h diff --git a/paddle/framework/prune_test.cc b/paddle/fluid/framework/prune_test.cc similarity index 100% rename from paddle/framework/prune_test.cc rename to paddle/fluid/framework/prune_test.cc diff --git a/paddle/framework/reader.cc b/paddle/fluid/framework/reader.cc similarity index 100% rename from paddle/framework/reader.cc rename to paddle/fluid/framework/reader.cc diff --git a/paddle/framework/reader.h b/paddle/fluid/framework/reader.h similarity index 100% rename from paddle/framework/reader.h rename to paddle/fluid/framework/reader.h diff --git a/paddle/framework/scope.cc b/paddle/fluid/framework/scope.cc similarity index 100% rename from paddle/framework/scope.cc rename to paddle/fluid/framework/scope.cc diff --git a/paddle/framework/scope.h b/paddle/fluid/framework/scope.h similarity index 100% rename from paddle/framework/scope.h rename to paddle/fluid/framework/scope.h diff --git a/paddle/framework/scope_test.cc b/paddle/fluid/framework/scope_test.cc similarity index 100% rename from paddle/framework/scope_test.cc rename to paddle/fluid/framework/scope_test.cc diff --git a/paddle/framework/selected_rows.cc b/paddle/fluid/framework/selected_rows.cc similarity index 100% rename from paddle/framework/selected_rows.cc rename to paddle/fluid/framework/selected_rows.cc diff --git a/paddle/framework/selected_rows.h b/paddle/fluid/framework/selected_rows.h similarity index 100% rename from paddle/framework/selected_rows.h rename to paddle/fluid/framework/selected_rows.h diff --git a/paddle/framework/selected_rows_test.cc b/paddle/fluid/framework/selected_rows_test.cc similarity index 100% rename from paddle/framework/selected_rows_test.cc rename to paddle/fluid/framework/selected_rows_test.cc diff --git a/paddle/framework/shape_inference.cc b/paddle/fluid/framework/shape_inference.cc similarity index 100% rename from paddle/framework/shape_inference.cc rename to paddle/fluid/framework/shape_inference.cc diff --git a/paddle/framework/shape_inference.h b/paddle/fluid/framework/shape_inference.h similarity index 100% rename from paddle/framework/shape_inference.h rename to paddle/fluid/framework/shape_inference.h diff --git a/paddle/framework/tensor.cc b/paddle/fluid/framework/tensor.cc similarity index 100% rename from paddle/framework/tensor.cc rename to paddle/fluid/framework/tensor.cc diff --git a/paddle/framework/tensor.h b/paddle/fluid/framework/tensor.h similarity index 100% rename from paddle/framework/tensor.h rename to paddle/fluid/framework/tensor.h diff --git a/paddle/framework/tensor.md b/paddle/fluid/framework/tensor.md similarity index 100% rename from paddle/framework/tensor.md rename to paddle/fluid/framework/tensor.md diff --git a/paddle/framework/tensor_impl.h b/paddle/fluid/framework/tensor_impl.h similarity index 100% rename from paddle/framework/tensor_impl.h rename to paddle/fluid/framework/tensor_impl.h diff --git a/paddle/framework/tensor_test.cc b/paddle/fluid/framework/tensor_test.cc similarity index 100% rename from paddle/framework/tensor_test.cc rename to paddle/fluid/framework/tensor_test.cc diff --git a/paddle/framework/tensor_util.cc b/paddle/fluid/framework/tensor_util.cc similarity index 100% rename from paddle/framework/tensor_util.cc rename to paddle/fluid/framework/tensor_util.cc diff --git a/paddle/framework/tensor_util.cu b/paddle/fluid/framework/tensor_util.cu similarity index 100% rename from paddle/framework/tensor_util.cu rename to paddle/fluid/framework/tensor_util.cu diff --git a/paddle/framework/tensor_util.h b/paddle/fluid/framework/tensor_util.h similarity index 100% rename from paddle/framework/tensor_util.h rename to paddle/fluid/framework/tensor_util.h diff --git a/paddle/framework/tensor_util_test.cc b/paddle/fluid/framework/tensor_util_test.cc similarity index 100% rename from paddle/framework/tensor_util_test.cc rename to paddle/fluid/framework/tensor_util_test.cc diff --git a/paddle/framework/tensor_util_test.cu b/paddle/fluid/framework/tensor_util_test.cu similarity index 100% rename from paddle/framework/tensor_util_test.cu rename to paddle/fluid/framework/tensor_util_test.cu diff --git a/paddle/framework/threadpool.cc b/paddle/fluid/framework/threadpool.cc similarity index 100% rename from paddle/framework/threadpool.cc rename to paddle/fluid/framework/threadpool.cc diff --git a/paddle/framework/threadpool.h b/paddle/fluid/framework/threadpool.h similarity index 100% rename from paddle/framework/threadpool.h rename to paddle/fluid/framework/threadpool.h diff --git a/paddle/framework/threadpool_test.cc b/paddle/fluid/framework/threadpool_test.cc similarity index 100% rename from paddle/framework/threadpool_test.cc rename to paddle/fluid/framework/threadpool_test.cc diff --git a/paddle/framework/type_defs.h b/paddle/fluid/framework/type_defs.h similarity index 100% rename from paddle/framework/type_defs.h rename to paddle/fluid/framework/type_defs.h diff --git a/paddle/framework/var_desc.cc b/paddle/fluid/framework/var_desc.cc similarity index 100% rename from paddle/framework/var_desc.cc rename to paddle/fluid/framework/var_desc.cc diff --git a/paddle/framework/var_desc.h b/paddle/fluid/framework/var_desc.h similarity index 100% rename from paddle/framework/var_desc.h rename to paddle/fluid/framework/var_desc.h diff --git a/paddle/framework/var_type.h b/paddle/fluid/framework/var_type.h similarity index 100% rename from paddle/framework/var_type.h rename to paddle/fluid/framework/var_type.h diff --git a/paddle/framework/var_type_inference.h b/paddle/fluid/framework/var_type_inference.h similarity index 100% rename from paddle/framework/var_type_inference.h rename to paddle/fluid/framework/var_type_inference.h diff --git a/paddle/framework/var_type_inference_test.cc b/paddle/fluid/framework/var_type_inference_test.cc similarity index 100% rename from paddle/framework/var_type_inference_test.cc rename to paddle/fluid/framework/var_type_inference_test.cc diff --git a/paddle/framework/variable.h b/paddle/fluid/framework/variable.h similarity index 100% rename from paddle/framework/variable.h rename to paddle/fluid/framework/variable.h diff --git a/paddle/framework/variable.md b/paddle/fluid/framework/variable.md similarity index 100% rename from paddle/framework/variable.md rename to paddle/fluid/framework/variable.md diff --git a/paddle/framework/variable_test.cc b/paddle/fluid/framework/variable_test.cc similarity index 100% rename from paddle/framework/variable_test.cc rename to paddle/fluid/framework/variable_test.cc diff --git a/paddle/inference/CMakeLists.txt b/paddle/fluid/inference/CMakeLists.txt similarity index 100% rename from paddle/inference/CMakeLists.txt rename to paddle/fluid/inference/CMakeLists.txt diff --git a/paddle/inference/io.cc b/paddle/fluid/inference/io.cc similarity index 100% rename from paddle/inference/io.cc rename to paddle/fluid/inference/io.cc diff --git a/paddle/inference/io.h b/paddle/fluid/inference/io.h similarity index 100% rename from paddle/inference/io.h rename to paddle/fluid/inference/io.h diff --git a/paddle/inference/tests/book/CMakeLists.txt b/paddle/fluid/inference/tests/book/CMakeLists.txt similarity index 100% rename from paddle/inference/tests/book/CMakeLists.txt rename to paddle/fluid/inference/tests/book/CMakeLists.txt diff --git a/paddle/inference/tests/book/test_helper.h b/paddle/fluid/inference/tests/book/test_helper.h similarity index 100% rename from paddle/inference/tests/book/test_helper.h rename to paddle/fluid/inference/tests/book/test_helper.h diff --git a/paddle/inference/tests/book/test_inference_fit_a_line.cc b/paddle/fluid/inference/tests/book/test_inference_fit_a_line.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_fit_a_line.cc rename to paddle/fluid/inference/tests/book/test_inference_fit_a_line.cc diff --git a/paddle/inference/tests/book/test_inference_image_classification.cc b/paddle/fluid/inference/tests/book/test_inference_image_classification.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_image_classification.cc rename to paddle/fluid/inference/tests/book/test_inference_image_classification.cc diff --git a/paddle/inference/tests/book/test_inference_label_semantic_roles.cc b/paddle/fluid/inference/tests/book/test_inference_label_semantic_roles.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_label_semantic_roles.cc rename to paddle/fluid/inference/tests/book/test_inference_label_semantic_roles.cc diff --git a/paddle/inference/tests/book/test_inference_recognize_digits.cc b/paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_recognize_digits.cc rename to paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc diff --git a/paddle/inference/tests/book/test_inference_recommender_system.cc b/paddle/fluid/inference/tests/book/test_inference_recommender_system.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_recommender_system.cc rename to paddle/fluid/inference/tests/book/test_inference_recommender_system.cc diff --git a/paddle/inference/tests/book/test_inference_rnn_encoder_decoder.cc b/paddle/fluid/inference/tests/book/test_inference_rnn_encoder_decoder.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_rnn_encoder_decoder.cc rename to paddle/fluid/inference/tests/book/test_inference_rnn_encoder_decoder.cc diff --git a/paddle/inference/tests/book/test_inference_understand_sentiment.cc b/paddle/fluid/inference/tests/book/test_inference_understand_sentiment.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_understand_sentiment.cc rename to paddle/fluid/inference/tests/book/test_inference_understand_sentiment.cc diff --git a/paddle/inference/tests/book/test_inference_word2vec.cc b/paddle/fluid/inference/tests/book/test_inference_word2vec.cc similarity index 100% rename from paddle/inference/tests/book/test_inference_word2vec.cc rename to paddle/fluid/inference/tests/book/test_inference_word2vec.cc diff --git a/paddle/memory/.clang-format b/paddle/fluid/memory/.clang-format similarity index 100% rename from paddle/memory/.clang-format rename to paddle/fluid/memory/.clang-format diff --git a/paddle/memory/CMakeLists.txt b/paddle/fluid/memory/CMakeLists.txt similarity index 100% rename from paddle/memory/CMakeLists.txt rename to paddle/fluid/memory/CMakeLists.txt diff --git a/paddle/memory/README.md b/paddle/fluid/memory/README.md similarity index 100% rename from paddle/memory/README.md rename to paddle/fluid/memory/README.md diff --git a/paddle/memory/detail/CMakeLists.txt b/paddle/fluid/memory/detail/CMakeLists.txt similarity index 100% rename from paddle/memory/detail/CMakeLists.txt rename to paddle/fluid/memory/detail/CMakeLists.txt diff --git a/paddle/memory/detail/buddy_allocator.cc b/paddle/fluid/memory/detail/buddy_allocator.cc similarity index 100% rename from paddle/memory/detail/buddy_allocator.cc rename to paddle/fluid/memory/detail/buddy_allocator.cc diff --git a/paddle/memory/detail/buddy_allocator.h b/paddle/fluid/memory/detail/buddy_allocator.h similarity index 100% rename from paddle/memory/detail/buddy_allocator.h rename to paddle/fluid/memory/detail/buddy_allocator.h diff --git a/paddle/memory/detail/memory_block.cc b/paddle/fluid/memory/detail/memory_block.cc similarity index 100% rename from paddle/memory/detail/memory_block.cc rename to paddle/fluid/memory/detail/memory_block.cc diff --git a/paddle/memory/detail/memory_block.h b/paddle/fluid/memory/detail/memory_block.h similarity index 100% rename from paddle/memory/detail/memory_block.h rename to paddle/fluid/memory/detail/memory_block.h diff --git a/paddle/memory/detail/meta_cache.cc b/paddle/fluid/memory/detail/meta_cache.cc similarity index 100% rename from paddle/memory/detail/meta_cache.cc rename to paddle/fluid/memory/detail/meta_cache.cc diff --git a/paddle/memory/detail/meta_cache.h b/paddle/fluid/memory/detail/meta_cache.h similarity index 100% rename from paddle/memory/detail/meta_cache.h rename to paddle/fluid/memory/detail/meta_cache.h diff --git a/paddle/memory/detail/meta_data.cc b/paddle/fluid/memory/detail/meta_data.cc similarity index 100% rename from paddle/memory/detail/meta_data.cc rename to paddle/fluid/memory/detail/meta_data.cc diff --git a/paddle/memory/detail/meta_data.h b/paddle/fluid/memory/detail/meta_data.h similarity index 100% rename from paddle/memory/detail/meta_data.h rename to paddle/fluid/memory/detail/meta_data.h diff --git a/paddle/memory/detail/system_allocator.cc b/paddle/fluid/memory/detail/system_allocator.cc similarity index 100% rename from paddle/memory/detail/system_allocator.cc rename to paddle/fluid/memory/detail/system_allocator.cc diff --git a/paddle/memory/detail/system_allocator.h b/paddle/fluid/memory/detail/system_allocator.h similarity index 100% rename from paddle/memory/detail/system_allocator.h rename to paddle/fluid/memory/detail/system_allocator.h diff --git a/paddle/memory/detail/system_allocator_test.cc b/paddle/fluid/memory/detail/system_allocator_test.cc similarity index 100% rename from paddle/memory/detail/system_allocator_test.cc rename to paddle/fluid/memory/detail/system_allocator_test.cc diff --git a/paddle/memory/memcpy.cc b/paddle/fluid/memory/memcpy.cc similarity index 100% rename from paddle/memory/memcpy.cc rename to paddle/fluid/memory/memcpy.cc diff --git a/paddle/memory/memcpy.h b/paddle/fluid/memory/memcpy.h similarity index 100% rename from paddle/memory/memcpy.h rename to paddle/fluid/memory/memcpy.h diff --git a/paddle/memory/memory.cc b/paddle/fluid/memory/memory.cc similarity index 100% rename from paddle/memory/memory.cc rename to paddle/fluid/memory/memory.cc diff --git a/paddle/memory/memory.h b/paddle/fluid/memory/memory.h similarity index 100% rename from paddle/memory/memory.h rename to paddle/fluid/memory/memory.h diff --git a/paddle/memory/memory_test.cc b/paddle/fluid/memory/memory_test.cc similarity index 100% rename from paddle/memory/memory_test.cc rename to paddle/fluid/memory/memory_test.cc diff --git a/paddle/operators/.clang-format b/paddle/fluid/operators/.clang-format similarity index 100% rename from paddle/operators/.clang-format rename to paddle/fluid/operators/.clang-format diff --git a/paddle/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt similarity index 100% rename from paddle/operators/CMakeLists.txt rename to paddle/fluid/operators/CMakeLists.txt diff --git a/paddle/operators/accuracy_op.cc b/paddle/fluid/operators/accuracy_op.cc similarity index 100% rename from paddle/operators/accuracy_op.cc rename to paddle/fluid/operators/accuracy_op.cc diff --git a/paddle/operators/accuracy_op.cu b/paddle/fluid/operators/accuracy_op.cu similarity index 100% rename from paddle/operators/accuracy_op.cu rename to paddle/fluid/operators/accuracy_op.cu diff --git a/paddle/operators/accuracy_op.h b/paddle/fluid/operators/accuracy_op.h similarity index 100% rename from paddle/operators/accuracy_op.h rename to paddle/fluid/operators/accuracy_op.h diff --git a/paddle/operators/activation_op.cc b/paddle/fluid/operators/activation_op.cc similarity index 100% rename from paddle/operators/activation_op.cc rename to paddle/fluid/operators/activation_op.cc diff --git a/paddle/operators/activation_op.cu b/paddle/fluid/operators/activation_op.cu similarity index 100% rename from paddle/operators/activation_op.cu rename to paddle/fluid/operators/activation_op.cu diff --git a/paddle/operators/activation_op.h b/paddle/fluid/operators/activation_op.h similarity index 100% rename from paddle/operators/activation_op.h rename to paddle/fluid/operators/activation_op.h diff --git a/paddle/operators/adadelta_op.cc b/paddle/fluid/operators/adadelta_op.cc similarity index 100% rename from paddle/operators/adadelta_op.cc rename to paddle/fluid/operators/adadelta_op.cc diff --git a/paddle/operators/adadelta_op.cu b/paddle/fluid/operators/adadelta_op.cu similarity index 100% rename from paddle/operators/adadelta_op.cu rename to paddle/fluid/operators/adadelta_op.cu diff --git a/paddle/operators/adadelta_op.h b/paddle/fluid/operators/adadelta_op.h similarity index 100% rename from paddle/operators/adadelta_op.h rename to paddle/fluid/operators/adadelta_op.h diff --git a/paddle/operators/adagrad_op.cc b/paddle/fluid/operators/adagrad_op.cc similarity index 100% rename from paddle/operators/adagrad_op.cc rename to paddle/fluid/operators/adagrad_op.cc diff --git a/paddle/operators/adagrad_op.cu b/paddle/fluid/operators/adagrad_op.cu similarity index 100% rename from paddle/operators/adagrad_op.cu rename to paddle/fluid/operators/adagrad_op.cu diff --git a/paddle/operators/adagrad_op.h b/paddle/fluid/operators/adagrad_op.h similarity index 100% rename from paddle/operators/adagrad_op.h rename to paddle/fluid/operators/adagrad_op.h diff --git a/paddle/operators/adam_op.cc b/paddle/fluid/operators/adam_op.cc similarity index 100% rename from paddle/operators/adam_op.cc rename to paddle/fluid/operators/adam_op.cc diff --git a/paddle/operators/adam_op.cu b/paddle/fluid/operators/adam_op.cu similarity index 100% rename from paddle/operators/adam_op.cu rename to paddle/fluid/operators/adam_op.cu diff --git a/paddle/operators/adam_op.h b/paddle/fluid/operators/adam_op.h similarity index 100% rename from paddle/operators/adam_op.h rename to paddle/fluid/operators/adam_op.h diff --git a/paddle/operators/adamax_op.cc b/paddle/fluid/operators/adamax_op.cc similarity index 100% rename from paddle/operators/adamax_op.cc rename to paddle/fluid/operators/adamax_op.cc diff --git a/paddle/operators/adamax_op.cu b/paddle/fluid/operators/adamax_op.cu similarity index 100% rename from paddle/operators/adamax_op.cu rename to paddle/fluid/operators/adamax_op.cu diff --git a/paddle/operators/adamax_op.h b/paddle/fluid/operators/adamax_op.h similarity index 100% rename from paddle/operators/adamax_op.h rename to paddle/fluid/operators/adamax_op.h diff --git a/paddle/operators/array_operator.h b/paddle/fluid/operators/array_operator.h similarity index 100% rename from paddle/operators/array_operator.h rename to paddle/fluid/operators/array_operator.h diff --git a/paddle/operators/array_to_lod_tensor_op.cc b/paddle/fluid/operators/array_to_lod_tensor_op.cc similarity index 100% rename from paddle/operators/array_to_lod_tensor_op.cc rename to paddle/fluid/operators/array_to_lod_tensor_op.cc diff --git a/paddle/operators/assign_op.cc b/paddle/fluid/operators/assign_op.cc similarity index 100% rename from paddle/operators/assign_op.cc rename to paddle/fluid/operators/assign_op.cc diff --git a/paddle/operators/assign_value_op.cc b/paddle/fluid/operators/assign_value_op.cc similarity index 100% rename from paddle/operators/assign_value_op.cc rename to paddle/fluid/operators/assign_value_op.cc diff --git a/paddle/operators/assign_value_op.cu.cc b/paddle/fluid/operators/assign_value_op.cu.cc similarity index 100% rename from paddle/operators/assign_value_op.cu.cc rename to paddle/fluid/operators/assign_value_op.cu.cc diff --git a/paddle/operators/assign_value_op.h b/paddle/fluid/operators/assign_value_op.h similarity index 100% rename from paddle/operators/assign_value_op.h rename to paddle/fluid/operators/assign_value_op.h diff --git a/paddle/operators/auc_op.cc b/paddle/fluid/operators/auc_op.cc similarity index 100% rename from paddle/operators/auc_op.cc rename to paddle/fluid/operators/auc_op.cc diff --git a/paddle/operators/auc_op.h b/paddle/fluid/operators/auc_op.h similarity index 100% rename from paddle/operators/auc_op.h rename to paddle/fluid/operators/auc_op.h diff --git a/paddle/operators/batch_norm_op.cc b/paddle/fluid/operators/batch_norm_op.cc similarity index 100% rename from paddle/operators/batch_norm_op.cc rename to paddle/fluid/operators/batch_norm_op.cc diff --git a/paddle/operators/batch_norm_op.cu.cc b/paddle/fluid/operators/batch_norm_op.cu.cc similarity index 100% rename from paddle/operators/batch_norm_op.cu.cc rename to paddle/fluid/operators/batch_norm_op.cu.cc diff --git a/paddle/operators/batch_norm_op.h b/paddle/fluid/operators/batch_norm_op.h similarity index 100% rename from paddle/operators/batch_norm_op.h rename to paddle/fluid/operators/batch_norm_op.h diff --git a/paddle/operators/beam_search_decode_op.cc b/paddle/fluid/operators/beam_search_decode_op.cc similarity index 100% rename from paddle/operators/beam_search_decode_op.cc rename to paddle/fluid/operators/beam_search_decode_op.cc diff --git a/paddle/operators/beam_search_decode_op.h b/paddle/fluid/operators/beam_search_decode_op.h similarity index 100% rename from paddle/operators/beam_search_decode_op.h rename to paddle/fluid/operators/beam_search_decode_op.h diff --git a/paddle/operators/beam_search_decode_op_test.cc b/paddle/fluid/operators/beam_search_decode_op_test.cc similarity index 100% rename from paddle/operators/beam_search_decode_op_test.cc rename to paddle/fluid/operators/beam_search_decode_op_test.cc diff --git a/paddle/operators/beam_search_op.cc b/paddle/fluid/operators/beam_search_op.cc similarity index 100% rename from paddle/operators/beam_search_op.cc rename to paddle/fluid/operators/beam_search_op.cc diff --git a/paddle/operators/beam_search_op.h b/paddle/fluid/operators/beam_search_op.h similarity index 100% rename from paddle/operators/beam_search_op.h rename to paddle/fluid/operators/beam_search_op.h diff --git a/paddle/operators/beam_search_op_test.cc b/paddle/fluid/operators/beam_search_op_test.cc similarity index 100% rename from paddle/operators/beam_search_op_test.cc rename to paddle/fluid/operators/beam_search_op_test.cc diff --git a/paddle/operators/bilinear_tensor_product_op.cc b/paddle/fluid/operators/bilinear_tensor_product_op.cc similarity index 100% rename from paddle/operators/bilinear_tensor_product_op.cc rename to paddle/fluid/operators/bilinear_tensor_product_op.cc diff --git a/paddle/operators/bilinear_tensor_product_op.cu b/paddle/fluid/operators/bilinear_tensor_product_op.cu similarity index 100% rename from paddle/operators/bilinear_tensor_product_op.cu rename to paddle/fluid/operators/bilinear_tensor_product_op.cu diff --git a/paddle/operators/bilinear_tensor_product_op.h b/paddle/fluid/operators/bilinear_tensor_product_op.h similarity index 100% rename from paddle/operators/bilinear_tensor_product_op.h rename to paddle/fluid/operators/bilinear_tensor_product_op.h diff --git a/paddle/operators/bipartite_match_op.cc b/paddle/fluid/operators/bipartite_match_op.cc similarity index 100% rename from paddle/operators/bipartite_match_op.cc rename to paddle/fluid/operators/bipartite_match_op.cc diff --git a/paddle/operators/box_coder_op.cc b/paddle/fluid/operators/box_coder_op.cc similarity index 100% rename from paddle/operators/box_coder_op.cc rename to paddle/fluid/operators/box_coder_op.cc diff --git a/paddle/operators/box_coder_op.cu b/paddle/fluid/operators/box_coder_op.cu similarity index 100% rename from paddle/operators/box_coder_op.cu rename to paddle/fluid/operators/box_coder_op.cu diff --git a/paddle/operators/box_coder_op.h b/paddle/fluid/operators/box_coder_op.h similarity index 100% rename from paddle/operators/box_coder_op.h rename to paddle/fluid/operators/box_coder_op.h diff --git a/paddle/operators/cast_op.cc b/paddle/fluid/operators/cast_op.cc similarity index 100% rename from paddle/operators/cast_op.cc rename to paddle/fluid/operators/cast_op.cc diff --git a/paddle/operators/cast_op.cu b/paddle/fluid/operators/cast_op.cu similarity index 100% rename from paddle/operators/cast_op.cu rename to paddle/fluid/operators/cast_op.cu diff --git a/paddle/operators/cast_op.h b/paddle/fluid/operators/cast_op.h similarity index 100% rename from paddle/operators/cast_op.h rename to paddle/fluid/operators/cast_op.h diff --git a/paddle/operators/chunk_eval_op.cc b/paddle/fluid/operators/chunk_eval_op.cc similarity index 100% rename from paddle/operators/chunk_eval_op.cc rename to paddle/fluid/operators/chunk_eval_op.cc diff --git a/paddle/operators/chunk_eval_op.h b/paddle/fluid/operators/chunk_eval_op.h similarity index 100% rename from paddle/operators/chunk_eval_op.h rename to paddle/fluid/operators/chunk_eval_op.h diff --git a/paddle/operators/clip_by_norm_op.cc b/paddle/fluid/operators/clip_by_norm_op.cc similarity index 100% rename from paddle/operators/clip_by_norm_op.cc rename to paddle/fluid/operators/clip_by_norm_op.cc diff --git a/paddle/operators/clip_by_norm_op.cu b/paddle/fluid/operators/clip_by_norm_op.cu similarity index 100% rename from paddle/operators/clip_by_norm_op.cu rename to paddle/fluid/operators/clip_by_norm_op.cu diff --git a/paddle/operators/clip_by_norm_op.h b/paddle/fluid/operators/clip_by_norm_op.h similarity index 100% rename from paddle/operators/clip_by_norm_op.h rename to paddle/fluid/operators/clip_by_norm_op.h diff --git a/paddle/operators/clip_op.cc b/paddle/fluid/operators/clip_op.cc similarity index 100% rename from paddle/operators/clip_op.cc rename to paddle/fluid/operators/clip_op.cc diff --git a/paddle/operators/clip_op.cu b/paddle/fluid/operators/clip_op.cu similarity index 100% rename from paddle/operators/clip_op.cu rename to paddle/fluid/operators/clip_op.cu diff --git a/paddle/operators/clip_op.h b/paddle/fluid/operators/clip_op.h similarity index 100% rename from paddle/operators/clip_op.h rename to paddle/fluid/operators/clip_op.h diff --git a/paddle/operators/compare_op.cc b/paddle/fluid/operators/compare_op.cc similarity index 100% rename from paddle/operators/compare_op.cc rename to paddle/fluid/operators/compare_op.cc diff --git a/paddle/operators/compare_op.cu b/paddle/fluid/operators/compare_op.cu similarity index 100% rename from paddle/operators/compare_op.cu rename to paddle/fluid/operators/compare_op.cu diff --git a/paddle/operators/compare_op.h b/paddle/fluid/operators/compare_op.h similarity index 100% rename from paddle/operators/compare_op.h rename to paddle/fluid/operators/compare_op.h diff --git a/paddle/operators/concat_op.cc b/paddle/fluid/operators/concat_op.cc similarity index 100% rename from paddle/operators/concat_op.cc rename to paddle/fluid/operators/concat_op.cc diff --git a/paddle/operators/concat_op.cu.cc b/paddle/fluid/operators/concat_op.cu.cc similarity index 100% rename from paddle/operators/concat_op.cu.cc rename to paddle/fluid/operators/concat_op.cu.cc diff --git a/paddle/operators/concat_op.h b/paddle/fluid/operators/concat_op.h similarity index 100% rename from paddle/operators/concat_op.h rename to paddle/fluid/operators/concat_op.h diff --git a/paddle/operators/cond_op.cc b/paddle/fluid/operators/cond_op.cc similarity index 100% rename from paddle/operators/cond_op.cc rename to paddle/fluid/operators/cond_op.cc diff --git a/paddle/operators/cond_op.h b/paddle/fluid/operators/cond_op.h similarity index 100% rename from paddle/operators/cond_op.h rename to paddle/fluid/operators/cond_op.h diff --git a/paddle/operators/conditional_block_op.cc b/paddle/fluid/operators/conditional_block_op.cc similarity index 100% rename from paddle/operators/conditional_block_op.cc rename to paddle/fluid/operators/conditional_block_op.cc diff --git a/paddle/operators/conv_cudnn_op.cu.cc b/paddle/fluid/operators/conv_cudnn_op.cu.cc similarity index 100% rename from paddle/operators/conv_cudnn_op.cu.cc rename to paddle/fluid/operators/conv_cudnn_op.cu.cc diff --git a/paddle/operators/conv_op.cc b/paddle/fluid/operators/conv_op.cc similarity index 100% rename from paddle/operators/conv_op.cc rename to paddle/fluid/operators/conv_op.cc diff --git a/paddle/operators/conv_op.cu.cc b/paddle/fluid/operators/conv_op.cu.cc similarity index 100% rename from paddle/operators/conv_op.cu.cc rename to paddle/fluid/operators/conv_op.cu.cc diff --git a/paddle/operators/conv_op.h b/paddle/fluid/operators/conv_op.h similarity index 100% rename from paddle/operators/conv_op.h rename to paddle/fluid/operators/conv_op.h diff --git a/paddle/operators/conv_shift_op.cc b/paddle/fluid/operators/conv_shift_op.cc similarity index 100% rename from paddle/operators/conv_shift_op.cc rename to paddle/fluid/operators/conv_shift_op.cc diff --git a/paddle/operators/conv_shift_op.cu b/paddle/fluid/operators/conv_shift_op.cu similarity index 100% rename from paddle/operators/conv_shift_op.cu rename to paddle/fluid/operators/conv_shift_op.cu diff --git a/paddle/operators/conv_shift_op.h b/paddle/fluid/operators/conv_shift_op.h similarity index 100% rename from paddle/operators/conv_shift_op.h rename to paddle/fluid/operators/conv_shift_op.h diff --git a/paddle/operators/conv_transpose_cudnn_op.cu.cc b/paddle/fluid/operators/conv_transpose_cudnn_op.cu.cc similarity index 100% rename from paddle/operators/conv_transpose_cudnn_op.cu.cc rename to paddle/fluid/operators/conv_transpose_cudnn_op.cu.cc diff --git a/paddle/operators/conv_transpose_op.cc b/paddle/fluid/operators/conv_transpose_op.cc similarity index 100% rename from paddle/operators/conv_transpose_op.cc rename to paddle/fluid/operators/conv_transpose_op.cc diff --git a/paddle/operators/conv_transpose_op.cu.cc b/paddle/fluid/operators/conv_transpose_op.cu.cc similarity index 100% rename from paddle/operators/conv_transpose_op.cu.cc rename to paddle/fluid/operators/conv_transpose_op.cu.cc diff --git a/paddle/operators/conv_transpose_op.h b/paddle/fluid/operators/conv_transpose_op.h similarity index 100% rename from paddle/operators/conv_transpose_op.h rename to paddle/fluid/operators/conv_transpose_op.h diff --git a/paddle/operators/cos_sim_op.cc b/paddle/fluid/operators/cos_sim_op.cc similarity index 100% rename from paddle/operators/cos_sim_op.cc rename to paddle/fluid/operators/cos_sim_op.cc diff --git a/paddle/operators/cos_sim_op.cu b/paddle/fluid/operators/cos_sim_op.cu similarity index 100% rename from paddle/operators/cos_sim_op.cu rename to paddle/fluid/operators/cos_sim_op.cu diff --git a/paddle/operators/cos_sim_op.h b/paddle/fluid/operators/cos_sim_op.h similarity index 100% rename from paddle/operators/cos_sim_op.h rename to paddle/fluid/operators/cos_sim_op.h diff --git a/paddle/operators/create_reader_op.cc b/paddle/fluid/operators/create_reader_op.cc similarity index 100% rename from paddle/operators/create_reader_op.cc rename to paddle/fluid/operators/create_reader_op.cc diff --git a/paddle/operators/crf_decoding_op.cc b/paddle/fluid/operators/crf_decoding_op.cc similarity index 100% rename from paddle/operators/crf_decoding_op.cc rename to paddle/fluid/operators/crf_decoding_op.cc diff --git a/paddle/operators/crf_decoding_op.h b/paddle/fluid/operators/crf_decoding_op.h similarity index 100% rename from paddle/operators/crf_decoding_op.h rename to paddle/fluid/operators/crf_decoding_op.h diff --git a/paddle/operators/crop_op.cc b/paddle/fluid/operators/crop_op.cc similarity index 100% rename from paddle/operators/crop_op.cc rename to paddle/fluid/operators/crop_op.cc diff --git a/paddle/operators/crop_op.cu b/paddle/fluid/operators/crop_op.cu similarity index 100% rename from paddle/operators/crop_op.cu rename to paddle/fluid/operators/crop_op.cu diff --git a/paddle/operators/crop_op.h b/paddle/fluid/operators/crop_op.h similarity index 100% rename from paddle/operators/crop_op.h rename to paddle/fluid/operators/crop_op.h diff --git a/paddle/operators/cross_entropy_op.cc b/paddle/fluid/operators/cross_entropy_op.cc similarity index 100% rename from paddle/operators/cross_entropy_op.cc rename to paddle/fluid/operators/cross_entropy_op.cc diff --git a/paddle/operators/cross_entropy_op.cu b/paddle/fluid/operators/cross_entropy_op.cu similarity index 100% rename from paddle/operators/cross_entropy_op.cu rename to paddle/fluid/operators/cross_entropy_op.cu diff --git a/paddle/operators/cross_entropy_op.h b/paddle/fluid/operators/cross_entropy_op.h similarity index 100% rename from paddle/operators/cross_entropy_op.h rename to paddle/fluid/operators/cross_entropy_op.h diff --git a/paddle/operators/ctc_align_op.cc b/paddle/fluid/operators/ctc_align_op.cc similarity index 100% rename from paddle/operators/ctc_align_op.cc rename to paddle/fluid/operators/ctc_align_op.cc diff --git a/paddle/operators/ctc_align_op.cu b/paddle/fluid/operators/ctc_align_op.cu similarity index 100% rename from paddle/operators/ctc_align_op.cu rename to paddle/fluid/operators/ctc_align_op.cu diff --git a/paddle/operators/ctc_align_op.h b/paddle/fluid/operators/ctc_align_op.h similarity index 100% rename from paddle/operators/ctc_align_op.h rename to paddle/fluid/operators/ctc_align_op.h diff --git a/paddle/operators/cum_op.h b/paddle/fluid/operators/cum_op.h similarity index 100% rename from paddle/operators/cum_op.h rename to paddle/fluid/operators/cum_op.h diff --git a/paddle/operators/cumsum_op.cc b/paddle/fluid/operators/cumsum_op.cc similarity index 100% rename from paddle/operators/cumsum_op.cc rename to paddle/fluid/operators/cumsum_op.cc diff --git a/paddle/operators/cumsum_op.cu b/paddle/fluid/operators/cumsum_op.cu similarity index 100% rename from paddle/operators/cumsum_op.cu rename to paddle/fluid/operators/cumsum_op.cu diff --git a/paddle/operators/decayed_adagrad_op.cc b/paddle/fluid/operators/decayed_adagrad_op.cc similarity index 100% rename from paddle/operators/decayed_adagrad_op.cc rename to paddle/fluid/operators/decayed_adagrad_op.cc diff --git a/paddle/operators/decayed_adagrad_op.cu b/paddle/fluid/operators/decayed_adagrad_op.cu similarity index 100% rename from paddle/operators/decayed_adagrad_op.cu rename to paddle/fluid/operators/decayed_adagrad_op.cu diff --git a/paddle/operators/decayed_adagrad_op.h b/paddle/fluid/operators/decayed_adagrad_op.h similarity index 100% rename from paddle/operators/decayed_adagrad_op.h rename to paddle/fluid/operators/decayed_adagrad_op.h diff --git a/paddle/operators/detail/CMakeLists.txt b/paddle/fluid/operators/detail/CMakeLists.txt similarity index 100% rename from paddle/operators/detail/CMakeLists.txt rename to paddle/fluid/operators/detail/CMakeLists.txt diff --git a/paddle/operators/detail/grpc_client.cc b/paddle/fluid/operators/detail/grpc_client.cc similarity index 100% rename from paddle/operators/detail/grpc_client.cc rename to paddle/fluid/operators/detail/grpc_client.cc diff --git a/paddle/operators/detail/grpc_client.h b/paddle/fluid/operators/detail/grpc_client.h similarity index 100% rename from paddle/operators/detail/grpc_client.h rename to paddle/fluid/operators/detail/grpc_client.h diff --git a/paddle/operators/detail/grpc_server.cc b/paddle/fluid/operators/detail/grpc_server.cc similarity index 100% rename from paddle/operators/detail/grpc_server.cc rename to paddle/fluid/operators/detail/grpc_server.cc diff --git a/paddle/operators/detail/grpc_server.h b/paddle/fluid/operators/detail/grpc_server.h similarity index 100% rename from paddle/operators/detail/grpc_server.h rename to paddle/fluid/operators/detail/grpc_server.h diff --git a/paddle/operators/detail/safe_ref.h b/paddle/fluid/operators/detail/safe_ref.h similarity index 100% rename from paddle/operators/detail/safe_ref.h rename to paddle/fluid/operators/detail/safe_ref.h diff --git a/paddle/operators/detail/send_recv.proto b/paddle/fluid/operators/detail/send_recv.proto similarity index 100% rename from paddle/operators/detail/send_recv.proto rename to paddle/fluid/operators/detail/send_recv.proto diff --git a/paddle/operators/detail/sendrecvop_utils.cc b/paddle/fluid/operators/detail/sendrecvop_utils.cc similarity index 100% rename from paddle/operators/detail/sendrecvop_utils.cc rename to paddle/fluid/operators/detail/sendrecvop_utils.cc diff --git a/paddle/operators/detail/sendrecvop_utils.h b/paddle/fluid/operators/detail/sendrecvop_utils.h similarity index 100% rename from paddle/operators/detail/sendrecvop_utils.h rename to paddle/fluid/operators/detail/sendrecvop_utils.h diff --git a/paddle/operators/detail/simple_block_queue.h b/paddle/fluid/operators/detail/simple_block_queue.h similarity index 100% rename from paddle/operators/detail/simple_block_queue.h rename to paddle/fluid/operators/detail/simple_block_queue.h diff --git a/paddle/operators/detail/strided_memcpy.h b/paddle/fluid/operators/detail/strided_memcpy.h similarity index 100% rename from paddle/operators/detail/strided_memcpy.h rename to paddle/fluid/operators/detail/strided_memcpy.h diff --git a/paddle/operators/detection_output_op.cc b/paddle/fluid/operators/detection_output_op.cc similarity index 100% rename from paddle/operators/detection_output_op.cc rename to paddle/fluid/operators/detection_output_op.cc diff --git a/paddle/operators/detection_output_op.cu.cc b/paddle/fluid/operators/detection_output_op.cu.cc similarity index 100% rename from paddle/operators/detection_output_op.cu.cc rename to paddle/fluid/operators/detection_output_op.cu.cc diff --git a/paddle/operators/detection_output_op.h b/paddle/fluid/operators/detection_output_op.h similarity index 100% rename from paddle/operators/detection_output_op.h rename to paddle/fluid/operators/detection_output_op.h diff --git a/paddle/operators/dropout_op.cc b/paddle/fluid/operators/dropout_op.cc similarity index 100% rename from paddle/operators/dropout_op.cc rename to paddle/fluid/operators/dropout_op.cc diff --git a/paddle/operators/dropout_op.cu b/paddle/fluid/operators/dropout_op.cu similarity index 100% rename from paddle/operators/dropout_op.cu rename to paddle/fluid/operators/dropout_op.cu diff --git a/paddle/operators/dropout_op.h b/paddle/fluid/operators/dropout_op.h similarity index 100% rename from paddle/operators/dropout_op.h rename to paddle/fluid/operators/dropout_op.h diff --git a/paddle/operators/edit_distance_op.cc b/paddle/fluid/operators/edit_distance_op.cc similarity index 100% rename from paddle/operators/edit_distance_op.cc rename to paddle/fluid/operators/edit_distance_op.cc diff --git a/paddle/operators/edit_distance_op.cu b/paddle/fluid/operators/edit_distance_op.cu similarity index 100% rename from paddle/operators/edit_distance_op.cu rename to paddle/fluid/operators/edit_distance_op.cu diff --git a/paddle/operators/edit_distance_op.h b/paddle/fluid/operators/edit_distance_op.h similarity index 100% rename from paddle/operators/edit_distance_op.h rename to paddle/fluid/operators/edit_distance_op.h diff --git a/paddle/operators/elementwise_add_op.cc b/paddle/fluid/operators/elementwise_add_op.cc similarity index 100% rename from paddle/operators/elementwise_add_op.cc rename to paddle/fluid/operators/elementwise_add_op.cc diff --git a/paddle/operators/elementwise_add_op.cu b/paddle/fluid/operators/elementwise_add_op.cu similarity index 100% rename from paddle/operators/elementwise_add_op.cu rename to paddle/fluid/operators/elementwise_add_op.cu diff --git a/paddle/operators/elementwise_add_op.h b/paddle/fluid/operators/elementwise_add_op.h similarity index 100% rename from paddle/operators/elementwise_add_op.h rename to paddle/fluid/operators/elementwise_add_op.h diff --git a/paddle/operators/elementwise_div_op.cc b/paddle/fluid/operators/elementwise_div_op.cc similarity index 100% rename from paddle/operators/elementwise_div_op.cc rename to paddle/fluid/operators/elementwise_div_op.cc diff --git a/paddle/operators/elementwise_div_op.cu b/paddle/fluid/operators/elementwise_div_op.cu similarity index 100% rename from paddle/operators/elementwise_div_op.cu rename to paddle/fluid/operators/elementwise_div_op.cu diff --git a/paddle/operators/elementwise_div_op.h b/paddle/fluid/operators/elementwise_div_op.h similarity index 100% rename from paddle/operators/elementwise_div_op.h rename to paddle/fluid/operators/elementwise_div_op.h diff --git a/paddle/operators/elementwise_max_op.cc b/paddle/fluid/operators/elementwise_max_op.cc similarity index 100% rename from paddle/operators/elementwise_max_op.cc rename to paddle/fluid/operators/elementwise_max_op.cc diff --git a/paddle/operators/elementwise_max_op.cu b/paddle/fluid/operators/elementwise_max_op.cu similarity index 100% rename from paddle/operators/elementwise_max_op.cu rename to paddle/fluid/operators/elementwise_max_op.cu diff --git a/paddle/operators/elementwise_max_op.h b/paddle/fluid/operators/elementwise_max_op.h similarity index 100% rename from paddle/operators/elementwise_max_op.h rename to paddle/fluid/operators/elementwise_max_op.h diff --git a/paddle/operators/elementwise_min_op.cc b/paddle/fluid/operators/elementwise_min_op.cc similarity index 100% rename from paddle/operators/elementwise_min_op.cc rename to paddle/fluid/operators/elementwise_min_op.cc diff --git a/paddle/operators/elementwise_min_op.cu b/paddle/fluid/operators/elementwise_min_op.cu similarity index 100% rename from paddle/operators/elementwise_min_op.cu rename to paddle/fluid/operators/elementwise_min_op.cu diff --git a/paddle/operators/elementwise_min_op.h b/paddle/fluid/operators/elementwise_min_op.h similarity index 100% rename from paddle/operators/elementwise_min_op.h rename to paddle/fluid/operators/elementwise_min_op.h diff --git a/paddle/operators/elementwise_mul_op.cc b/paddle/fluid/operators/elementwise_mul_op.cc similarity index 100% rename from paddle/operators/elementwise_mul_op.cc rename to paddle/fluid/operators/elementwise_mul_op.cc diff --git a/paddle/operators/elementwise_mul_op.cu b/paddle/fluid/operators/elementwise_mul_op.cu similarity index 100% rename from paddle/operators/elementwise_mul_op.cu rename to paddle/fluid/operators/elementwise_mul_op.cu diff --git a/paddle/operators/elementwise_mul_op.h b/paddle/fluid/operators/elementwise_mul_op.h similarity index 100% rename from paddle/operators/elementwise_mul_op.h rename to paddle/fluid/operators/elementwise_mul_op.h diff --git a/paddle/operators/elementwise_op.h b/paddle/fluid/operators/elementwise_op.h similarity index 100% rename from paddle/operators/elementwise_op.h rename to paddle/fluid/operators/elementwise_op.h diff --git a/paddle/operators/elementwise_op_function.h b/paddle/fluid/operators/elementwise_op_function.h similarity index 100% rename from paddle/operators/elementwise_op_function.h rename to paddle/fluid/operators/elementwise_op_function.h diff --git a/paddle/operators/elementwise_pow_op.cc b/paddle/fluid/operators/elementwise_pow_op.cc similarity index 100% rename from paddle/operators/elementwise_pow_op.cc rename to paddle/fluid/operators/elementwise_pow_op.cc diff --git a/paddle/operators/elementwise_pow_op.cu b/paddle/fluid/operators/elementwise_pow_op.cu similarity index 100% rename from paddle/operators/elementwise_pow_op.cu rename to paddle/fluid/operators/elementwise_pow_op.cu diff --git a/paddle/operators/elementwise_pow_op.h b/paddle/fluid/operators/elementwise_pow_op.h similarity index 100% rename from paddle/operators/elementwise_pow_op.h rename to paddle/fluid/operators/elementwise_pow_op.h diff --git a/paddle/operators/elementwise_sub_op.cc b/paddle/fluid/operators/elementwise_sub_op.cc similarity index 100% rename from paddle/operators/elementwise_sub_op.cc rename to paddle/fluid/operators/elementwise_sub_op.cc diff --git a/paddle/operators/elementwise_sub_op.cu b/paddle/fluid/operators/elementwise_sub_op.cu similarity index 100% rename from paddle/operators/elementwise_sub_op.cu rename to paddle/fluid/operators/elementwise_sub_op.cu diff --git a/paddle/operators/elementwise_sub_op.h b/paddle/fluid/operators/elementwise_sub_op.h similarity index 100% rename from paddle/operators/elementwise_sub_op.h rename to paddle/fluid/operators/elementwise_sub_op.h diff --git a/paddle/operators/expand_op.cc b/paddle/fluid/operators/expand_op.cc similarity index 100% rename from paddle/operators/expand_op.cc rename to paddle/fluid/operators/expand_op.cc diff --git a/paddle/operators/expand_op.cu b/paddle/fluid/operators/expand_op.cu similarity index 100% rename from paddle/operators/expand_op.cu rename to paddle/fluid/operators/expand_op.cu diff --git a/paddle/operators/expand_op.h b/paddle/fluid/operators/expand_op.h similarity index 100% rename from paddle/operators/expand_op.h rename to paddle/fluid/operators/expand_op.h diff --git a/paddle/operators/feed_op.cc b/paddle/fluid/operators/feed_op.cc similarity index 100% rename from paddle/operators/feed_op.cc rename to paddle/fluid/operators/feed_op.cc diff --git a/paddle/operators/fetch_op.cc b/paddle/fluid/operators/fetch_op.cc similarity index 100% rename from paddle/operators/fetch_op.cc rename to paddle/fluid/operators/fetch_op.cc diff --git a/paddle/operators/fill_constant_batch_size_like_op.cc b/paddle/fluid/operators/fill_constant_batch_size_like_op.cc similarity index 100% rename from paddle/operators/fill_constant_batch_size_like_op.cc rename to paddle/fluid/operators/fill_constant_batch_size_like_op.cc diff --git a/paddle/operators/fill_constant_batch_size_like_op.cu.cc b/paddle/fluid/operators/fill_constant_batch_size_like_op.cu.cc similarity index 100% rename from paddle/operators/fill_constant_batch_size_like_op.cu.cc rename to paddle/fluid/operators/fill_constant_batch_size_like_op.cu.cc diff --git a/paddle/operators/fill_constant_batch_size_like_op.h b/paddle/fluid/operators/fill_constant_batch_size_like_op.h similarity index 100% rename from paddle/operators/fill_constant_batch_size_like_op.h rename to paddle/fluid/operators/fill_constant_batch_size_like_op.h diff --git a/paddle/operators/fill_constant_op.cc b/paddle/fluid/operators/fill_constant_op.cc similarity index 100% rename from paddle/operators/fill_constant_op.cc rename to paddle/fluid/operators/fill_constant_op.cc diff --git a/paddle/operators/fill_op.cc b/paddle/fluid/operators/fill_op.cc similarity index 100% rename from paddle/operators/fill_op.cc rename to paddle/fluid/operators/fill_op.cc diff --git a/paddle/operators/fill_zeros_like_op.cc b/paddle/fluid/operators/fill_zeros_like_op.cc similarity index 100% rename from paddle/operators/fill_zeros_like_op.cc rename to paddle/fluid/operators/fill_zeros_like_op.cc diff --git a/paddle/operators/fill_zeros_like_op.cu.cc b/paddle/fluid/operators/fill_zeros_like_op.cu.cc similarity index 100% rename from paddle/operators/fill_zeros_like_op.cu.cc rename to paddle/fluid/operators/fill_zeros_like_op.cu.cc diff --git a/paddle/operators/fill_zeros_like_op.h b/paddle/fluid/operators/fill_zeros_like_op.h similarity index 100% rename from paddle/operators/fill_zeros_like_op.h rename to paddle/fluid/operators/fill_zeros_like_op.h diff --git a/paddle/operators/ftrl_op.cc b/paddle/fluid/operators/ftrl_op.cc similarity index 100% rename from paddle/operators/ftrl_op.cc rename to paddle/fluid/operators/ftrl_op.cc diff --git a/paddle/operators/ftrl_op.cu b/paddle/fluid/operators/ftrl_op.cu similarity index 100% rename from paddle/operators/ftrl_op.cu rename to paddle/fluid/operators/ftrl_op.cu diff --git a/paddle/operators/ftrl_op.h b/paddle/fluid/operators/ftrl_op.h similarity index 100% rename from paddle/operators/ftrl_op.h rename to paddle/fluid/operators/ftrl_op.h diff --git a/paddle/operators/gather.cu.h b/paddle/fluid/operators/gather.cu.h similarity index 100% rename from paddle/operators/gather.cu.h rename to paddle/fluid/operators/gather.cu.h diff --git a/paddle/operators/gather.h b/paddle/fluid/operators/gather.h similarity index 100% rename from paddle/operators/gather.h rename to paddle/fluid/operators/gather.h diff --git a/paddle/operators/gather_op.cc b/paddle/fluid/operators/gather_op.cc similarity index 100% rename from paddle/operators/gather_op.cc rename to paddle/fluid/operators/gather_op.cc diff --git a/paddle/operators/gather_op.cu b/paddle/fluid/operators/gather_op.cu similarity index 100% rename from paddle/operators/gather_op.cu rename to paddle/fluid/operators/gather_op.cu diff --git a/paddle/operators/gather_op.h b/paddle/fluid/operators/gather_op.h similarity index 100% rename from paddle/operators/gather_op.h rename to paddle/fluid/operators/gather_op.h diff --git a/paddle/operators/gather_test.cc b/paddle/fluid/operators/gather_test.cc similarity index 100% rename from paddle/operators/gather_test.cc rename to paddle/fluid/operators/gather_test.cc diff --git a/paddle/operators/gaussian_random_op.cc b/paddle/fluid/operators/gaussian_random_op.cc similarity index 100% rename from paddle/operators/gaussian_random_op.cc rename to paddle/fluid/operators/gaussian_random_op.cc diff --git a/paddle/operators/gaussian_random_op.cu b/paddle/fluid/operators/gaussian_random_op.cu similarity index 100% rename from paddle/operators/gaussian_random_op.cu rename to paddle/fluid/operators/gaussian_random_op.cu diff --git a/paddle/operators/get_places_op.cc b/paddle/fluid/operators/get_places_op.cc similarity index 100% rename from paddle/operators/get_places_op.cc rename to paddle/fluid/operators/get_places_op.cc diff --git a/paddle/operators/gru_op.cc b/paddle/fluid/operators/gru_op.cc similarity index 100% rename from paddle/operators/gru_op.cc rename to paddle/fluid/operators/gru_op.cc diff --git a/paddle/operators/gru_op.cu.cc b/paddle/fluid/operators/gru_op.cu.cc similarity index 100% rename from paddle/operators/gru_op.cu.cc rename to paddle/fluid/operators/gru_op.cu.cc diff --git a/paddle/operators/gru_op.h b/paddle/fluid/operators/gru_op.h similarity index 100% rename from paddle/operators/gru_op.h rename to paddle/fluid/operators/gru_op.h diff --git a/paddle/operators/gru_unit_op.cc b/paddle/fluid/operators/gru_unit_op.cc similarity index 100% rename from paddle/operators/gru_unit_op.cc rename to paddle/fluid/operators/gru_unit_op.cc diff --git a/paddle/operators/gru_unit_op.cu b/paddle/fluid/operators/gru_unit_op.cu similarity index 100% rename from paddle/operators/gru_unit_op.cu rename to paddle/fluid/operators/gru_unit_op.cu diff --git a/paddle/operators/gru_unit_op.h b/paddle/fluid/operators/gru_unit_op.h similarity index 100% rename from paddle/operators/gru_unit_op.h rename to paddle/fluid/operators/gru_unit_op.h diff --git a/paddle/operators/hinge_loss_op.cc b/paddle/fluid/operators/hinge_loss_op.cc similarity index 100% rename from paddle/operators/hinge_loss_op.cc rename to paddle/fluid/operators/hinge_loss_op.cc diff --git a/paddle/operators/hinge_loss_op.cu b/paddle/fluid/operators/hinge_loss_op.cu similarity index 100% rename from paddle/operators/hinge_loss_op.cu rename to paddle/fluid/operators/hinge_loss_op.cu diff --git a/paddle/operators/hinge_loss_op.h b/paddle/fluid/operators/hinge_loss_op.h similarity index 100% rename from paddle/operators/hinge_loss_op.h rename to paddle/fluid/operators/hinge_loss_op.h diff --git a/paddle/operators/huber_loss_op.cc b/paddle/fluid/operators/huber_loss_op.cc similarity index 100% rename from paddle/operators/huber_loss_op.cc rename to paddle/fluid/operators/huber_loss_op.cc diff --git a/paddle/operators/huber_loss_op.cu b/paddle/fluid/operators/huber_loss_op.cu similarity index 100% rename from paddle/operators/huber_loss_op.cu rename to paddle/fluid/operators/huber_loss_op.cu diff --git a/paddle/operators/huber_loss_op.h b/paddle/fluid/operators/huber_loss_op.h similarity index 100% rename from paddle/operators/huber_loss_op.h rename to paddle/fluid/operators/huber_loss_op.h diff --git a/paddle/operators/im2sequence_op.cc b/paddle/fluid/operators/im2sequence_op.cc similarity index 100% rename from paddle/operators/im2sequence_op.cc rename to paddle/fluid/operators/im2sequence_op.cc diff --git a/paddle/operators/im2sequence_op.cu b/paddle/fluid/operators/im2sequence_op.cu similarity index 100% rename from paddle/operators/im2sequence_op.cu rename to paddle/fluid/operators/im2sequence_op.cu diff --git a/paddle/operators/im2sequence_op.h b/paddle/fluid/operators/im2sequence_op.h similarity index 100% rename from paddle/operators/im2sequence_op.h rename to paddle/fluid/operators/im2sequence_op.h diff --git a/paddle/operators/images/batch_norm_fork.dot b/paddle/fluid/operators/images/batch_norm_fork.dot similarity index 100% rename from paddle/operators/images/batch_norm_fork.dot rename to paddle/fluid/operators/images/batch_norm_fork.dot diff --git a/paddle/operators/images/batch_norm_fork.png b/paddle/fluid/operators/images/batch_norm_fork.png similarity index 100% rename from paddle/operators/images/batch_norm_fork.png rename to paddle/fluid/operators/images/batch_norm_fork.png diff --git a/paddle/operators/images/batch_norm_op_kernel.png b/paddle/fluid/operators/images/batch_norm_op_kernel.png similarity index 100% rename from paddle/operators/images/batch_norm_op_kernel.png rename to paddle/fluid/operators/images/batch_norm_op_kernel.png diff --git a/paddle/operators/increment_op.cc b/paddle/fluid/operators/increment_op.cc similarity index 100% rename from paddle/operators/increment_op.cc rename to paddle/fluid/operators/increment_op.cc diff --git a/paddle/operators/iou_similarity_op.cc b/paddle/fluid/operators/iou_similarity_op.cc similarity index 100% rename from paddle/operators/iou_similarity_op.cc rename to paddle/fluid/operators/iou_similarity_op.cc diff --git a/paddle/operators/iou_similarity_op.cu b/paddle/fluid/operators/iou_similarity_op.cu similarity index 100% rename from paddle/operators/iou_similarity_op.cu rename to paddle/fluid/operators/iou_similarity_op.cu diff --git a/paddle/operators/iou_similarity_op.h b/paddle/fluid/operators/iou_similarity_op.h similarity index 100% rename from paddle/operators/iou_similarity_op.h rename to paddle/fluid/operators/iou_similarity_op.h diff --git a/paddle/operators/is_empty_op.cc b/paddle/fluid/operators/is_empty_op.cc similarity index 100% rename from paddle/operators/is_empty_op.cc rename to paddle/fluid/operators/is_empty_op.cc diff --git a/paddle/operators/l1_norm_op.cc b/paddle/fluid/operators/l1_norm_op.cc similarity index 100% rename from paddle/operators/l1_norm_op.cc rename to paddle/fluid/operators/l1_norm_op.cc diff --git a/paddle/operators/l1_norm_op.cu b/paddle/fluid/operators/l1_norm_op.cu similarity index 100% rename from paddle/operators/l1_norm_op.cu rename to paddle/fluid/operators/l1_norm_op.cu diff --git a/paddle/operators/l1_norm_op.h b/paddle/fluid/operators/l1_norm_op.h similarity index 100% rename from paddle/operators/l1_norm_op.h rename to paddle/fluid/operators/l1_norm_op.h diff --git a/paddle/operators/label_smooth_op.cc b/paddle/fluid/operators/label_smooth_op.cc similarity index 100% rename from paddle/operators/label_smooth_op.cc rename to paddle/fluid/operators/label_smooth_op.cc diff --git a/paddle/operators/label_smooth_op.cu b/paddle/fluid/operators/label_smooth_op.cu similarity index 100% rename from paddle/operators/label_smooth_op.cu rename to paddle/fluid/operators/label_smooth_op.cu diff --git a/paddle/operators/label_smooth_op.h b/paddle/fluid/operators/label_smooth_op.h similarity index 100% rename from paddle/operators/label_smooth_op.h rename to paddle/fluid/operators/label_smooth_op.h diff --git a/paddle/operators/layer_norm_op.cc b/paddle/fluid/operators/layer_norm_op.cc similarity index 100% rename from paddle/operators/layer_norm_op.cc rename to paddle/fluid/operators/layer_norm_op.cc diff --git a/paddle/operators/layer_norm_op.cu b/paddle/fluid/operators/layer_norm_op.cu similarity index 100% rename from paddle/operators/layer_norm_op.cu rename to paddle/fluid/operators/layer_norm_op.cu diff --git a/paddle/operators/layer_norm_op.h b/paddle/fluid/operators/layer_norm_op.h similarity index 100% rename from paddle/operators/layer_norm_op.h rename to paddle/fluid/operators/layer_norm_op.h diff --git a/paddle/operators/linear_chain_crf_op.cc b/paddle/fluid/operators/linear_chain_crf_op.cc similarity index 100% rename from paddle/operators/linear_chain_crf_op.cc rename to paddle/fluid/operators/linear_chain_crf_op.cc diff --git a/paddle/operators/linear_chain_crf_op.cu b/paddle/fluid/operators/linear_chain_crf_op.cu similarity index 100% rename from paddle/operators/linear_chain_crf_op.cu rename to paddle/fluid/operators/linear_chain_crf_op.cu diff --git a/paddle/operators/linear_chain_crf_op.h b/paddle/fluid/operators/linear_chain_crf_op.h similarity index 100% rename from paddle/operators/linear_chain_crf_op.h rename to paddle/fluid/operators/linear_chain_crf_op.h diff --git a/paddle/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc similarity index 100% rename from paddle/operators/listen_and_serv_op.cc rename to paddle/fluid/operators/listen_and_serv_op.cc diff --git a/paddle/operators/load_combine_op.cc b/paddle/fluid/operators/load_combine_op.cc similarity index 100% rename from paddle/operators/load_combine_op.cc rename to paddle/fluid/operators/load_combine_op.cc diff --git a/paddle/operators/load_op.cc b/paddle/fluid/operators/load_op.cc similarity index 100% rename from paddle/operators/load_op.cc rename to paddle/fluid/operators/load_op.cc diff --git a/paddle/operators/lod_array_length_op.cc b/paddle/fluid/operators/lod_array_length_op.cc similarity index 100% rename from paddle/operators/lod_array_length_op.cc rename to paddle/fluid/operators/lod_array_length_op.cc diff --git a/paddle/operators/lod_rank_table_op.cc b/paddle/fluid/operators/lod_rank_table_op.cc similarity index 100% rename from paddle/operators/lod_rank_table_op.cc rename to paddle/fluid/operators/lod_rank_table_op.cc diff --git a/paddle/operators/lod_reset_op.cc b/paddle/fluid/operators/lod_reset_op.cc similarity index 100% rename from paddle/operators/lod_reset_op.cc rename to paddle/fluid/operators/lod_reset_op.cc diff --git a/paddle/operators/lod_reset_op.cu b/paddle/fluid/operators/lod_reset_op.cu similarity index 100% rename from paddle/operators/lod_reset_op.cu rename to paddle/fluid/operators/lod_reset_op.cu diff --git a/paddle/operators/lod_reset_op.h b/paddle/fluid/operators/lod_reset_op.h similarity index 100% rename from paddle/operators/lod_reset_op.h rename to paddle/fluid/operators/lod_reset_op.h diff --git a/paddle/operators/lod_tensor_to_array_op.cc b/paddle/fluid/operators/lod_tensor_to_array_op.cc similarity index 100% rename from paddle/operators/lod_tensor_to_array_op.cc rename to paddle/fluid/operators/lod_tensor_to_array_op.cc diff --git a/paddle/operators/log_loss_op.cc b/paddle/fluid/operators/log_loss_op.cc similarity index 100% rename from paddle/operators/log_loss_op.cc rename to paddle/fluid/operators/log_loss_op.cc diff --git a/paddle/operators/log_loss_op.cu b/paddle/fluid/operators/log_loss_op.cu similarity index 100% rename from paddle/operators/log_loss_op.cu rename to paddle/fluid/operators/log_loss_op.cu diff --git a/paddle/operators/log_loss_op.h b/paddle/fluid/operators/log_loss_op.h similarity index 100% rename from paddle/operators/log_loss_op.h rename to paddle/fluid/operators/log_loss_op.h diff --git a/paddle/operators/logical_op.cc b/paddle/fluid/operators/logical_op.cc similarity index 100% rename from paddle/operators/logical_op.cc rename to paddle/fluid/operators/logical_op.cc diff --git a/paddle/operators/logical_op.cu b/paddle/fluid/operators/logical_op.cu similarity index 100% rename from paddle/operators/logical_op.cu rename to paddle/fluid/operators/logical_op.cu diff --git a/paddle/operators/logical_op.h b/paddle/fluid/operators/logical_op.h similarity index 100% rename from paddle/operators/logical_op.h rename to paddle/fluid/operators/logical_op.h diff --git a/paddle/operators/lookup_table_op.cc b/paddle/fluid/operators/lookup_table_op.cc similarity index 100% rename from paddle/operators/lookup_table_op.cc rename to paddle/fluid/operators/lookup_table_op.cc diff --git a/paddle/operators/lookup_table_op.cu b/paddle/fluid/operators/lookup_table_op.cu similarity index 100% rename from paddle/operators/lookup_table_op.cu rename to paddle/fluid/operators/lookup_table_op.cu diff --git a/paddle/operators/lookup_table_op.h b/paddle/fluid/operators/lookup_table_op.h similarity index 100% rename from paddle/operators/lookup_table_op.h rename to paddle/fluid/operators/lookup_table_op.h diff --git a/paddle/operators/lrn_op.cc b/paddle/fluid/operators/lrn_op.cc similarity index 100% rename from paddle/operators/lrn_op.cc rename to paddle/fluid/operators/lrn_op.cc diff --git a/paddle/operators/lrn_op.cu b/paddle/fluid/operators/lrn_op.cu similarity index 100% rename from paddle/operators/lrn_op.cu rename to paddle/fluid/operators/lrn_op.cu diff --git a/paddle/operators/lrn_op.h b/paddle/fluid/operators/lrn_op.h similarity index 100% rename from paddle/operators/lrn_op.h rename to paddle/fluid/operators/lrn_op.h diff --git a/paddle/operators/lstm_op.cc b/paddle/fluid/operators/lstm_op.cc similarity index 100% rename from paddle/operators/lstm_op.cc rename to paddle/fluid/operators/lstm_op.cc diff --git a/paddle/operators/lstm_op.cu.cc b/paddle/fluid/operators/lstm_op.cu.cc similarity index 100% rename from paddle/operators/lstm_op.cu.cc rename to paddle/fluid/operators/lstm_op.cu.cc diff --git a/paddle/operators/lstm_op.h b/paddle/fluid/operators/lstm_op.h similarity index 100% rename from paddle/operators/lstm_op.h rename to paddle/fluid/operators/lstm_op.h diff --git a/paddle/operators/lstm_unit_op.cc b/paddle/fluid/operators/lstm_unit_op.cc similarity index 100% rename from paddle/operators/lstm_unit_op.cc rename to paddle/fluid/operators/lstm_unit_op.cc diff --git a/paddle/operators/lstm_unit_op.cu b/paddle/fluid/operators/lstm_unit_op.cu similarity index 100% rename from paddle/operators/lstm_unit_op.cu rename to paddle/fluid/operators/lstm_unit_op.cu diff --git a/paddle/operators/lstm_unit_op.h b/paddle/fluid/operators/lstm_unit_op.h similarity index 100% rename from paddle/operators/lstm_unit_op.h rename to paddle/fluid/operators/lstm_unit_op.h diff --git a/paddle/operators/lstmp_op.cc b/paddle/fluid/operators/lstmp_op.cc similarity index 100% rename from paddle/operators/lstmp_op.cc rename to paddle/fluid/operators/lstmp_op.cc diff --git a/paddle/operators/lstmp_op.cu b/paddle/fluid/operators/lstmp_op.cu similarity index 100% rename from paddle/operators/lstmp_op.cu rename to paddle/fluid/operators/lstmp_op.cu diff --git a/paddle/operators/lstmp_op.h b/paddle/fluid/operators/lstmp_op.h similarity index 100% rename from paddle/operators/lstmp_op.h rename to paddle/fluid/operators/lstmp_op.h diff --git a/paddle/operators/margin_rank_loss_op.cc b/paddle/fluid/operators/margin_rank_loss_op.cc similarity index 100% rename from paddle/operators/margin_rank_loss_op.cc rename to paddle/fluid/operators/margin_rank_loss_op.cc diff --git a/paddle/operators/margin_rank_loss_op.cu b/paddle/fluid/operators/margin_rank_loss_op.cu similarity index 100% rename from paddle/operators/margin_rank_loss_op.cu rename to paddle/fluid/operators/margin_rank_loss_op.cu diff --git a/paddle/operators/margin_rank_loss_op.h b/paddle/fluid/operators/margin_rank_loss_op.h similarity index 100% rename from paddle/operators/margin_rank_loss_op.h rename to paddle/fluid/operators/margin_rank_loss_op.h diff --git a/paddle/operators/math/CMakeLists.txt b/paddle/fluid/operators/math/CMakeLists.txt similarity index 100% rename from paddle/operators/math/CMakeLists.txt rename to paddle/fluid/operators/math/CMakeLists.txt diff --git a/paddle/operators/math/context_project.cc b/paddle/fluid/operators/math/context_project.cc similarity index 100% rename from paddle/operators/math/context_project.cc rename to paddle/fluid/operators/math/context_project.cc diff --git a/paddle/operators/math/context_project.cu b/paddle/fluid/operators/math/context_project.cu similarity index 100% rename from paddle/operators/math/context_project.cu rename to paddle/fluid/operators/math/context_project.cu diff --git a/paddle/operators/math/context_project.h b/paddle/fluid/operators/math/context_project.h similarity index 100% rename from paddle/operators/math/context_project.h rename to paddle/fluid/operators/math/context_project.h diff --git a/paddle/operators/math/cos_sim_functor.cc b/paddle/fluid/operators/math/cos_sim_functor.cc similarity index 100% rename from paddle/operators/math/cos_sim_functor.cc rename to paddle/fluid/operators/math/cos_sim_functor.cc diff --git a/paddle/operators/math/cos_sim_functor.cu b/paddle/fluid/operators/math/cos_sim_functor.cu similarity index 100% rename from paddle/operators/math/cos_sim_functor.cu rename to paddle/fluid/operators/math/cos_sim_functor.cu diff --git a/paddle/operators/math/cos_sim_functor.h b/paddle/fluid/operators/math/cos_sim_functor.h similarity index 100% rename from paddle/operators/math/cos_sim_functor.h rename to paddle/fluid/operators/math/cos_sim_functor.h diff --git a/paddle/operators/math/cross_entropy.cc b/paddle/fluid/operators/math/cross_entropy.cc similarity index 100% rename from paddle/operators/math/cross_entropy.cc rename to paddle/fluid/operators/math/cross_entropy.cc diff --git a/paddle/operators/math/cross_entropy.cu b/paddle/fluid/operators/math/cross_entropy.cu similarity index 100% rename from paddle/operators/math/cross_entropy.cu rename to paddle/fluid/operators/math/cross_entropy.cu diff --git a/paddle/operators/math/cross_entropy.h b/paddle/fluid/operators/math/cross_entropy.h similarity index 100% rename from paddle/operators/math/cross_entropy.h rename to paddle/fluid/operators/math/cross_entropy.h diff --git a/paddle/operators/math/depthwise_conv.cu b/paddle/fluid/operators/math/depthwise_conv.cu similarity index 100% rename from paddle/operators/math/depthwise_conv.cu rename to paddle/fluid/operators/math/depthwise_conv.cu diff --git a/paddle/operators/math/depthwise_conv.h b/paddle/fluid/operators/math/depthwise_conv.h similarity index 100% rename from paddle/operators/math/depthwise_conv.h rename to paddle/fluid/operators/math/depthwise_conv.h diff --git a/paddle/operators/math/detail/CMakeLists.txt b/paddle/fluid/operators/math/detail/CMakeLists.txt similarity index 100% rename from paddle/operators/math/detail/CMakeLists.txt rename to paddle/fluid/operators/math/detail/CMakeLists.txt diff --git a/paddle/operators/math/detail/activation_functions.h b/paddle/fluid/operators/math/detail/activation_functions.h similarity index 100% rename from paddle/operators/math/detail/activation_functions.h rename to paddle/fluid/operators/math/detail/activation_functions.h diff --git a/paddle/operators/math/detail/avx_functions.cc b/paddle/fluid/operators/math/detail/avx_functions.cc similarity index 100% rename from paddle/operators/math/detail/avx_functions.cc rename to paddle/fluid/operators/math/detail/avx_functions.cc diff --git a/paddle/operators/math/detail/gru_cpu_kernel.h b/paddle/fluid/operators/math/detail/gru_cpu_kernel.h similarity index 100% rename from paddle/operators/math/detail/gru_cpu_kernel.h rename to paddle/fluid/operators/math/detail/gru_cpu_kernel.h diff --git a/paddle/operators/math/detail/gru_gpu_kernel.h b/paddle/fluid/operators/math/detail/gru_gpu_kernel.h similarity index 100% rename from paddle/operators/math/detail/gru_gpu_kernel.h rename to paddle/fluid/operators/math/detail/gru_gpu_kernel.h diff --git a/paddle/operators/math/detail/gru_kernel.h b/paddle/fluid/operators/math/detail/gru_kernel.h similarity index 100% rename from paddle/operators/math/detail/gru_kernel.h rename to paddle/fluid/operators/math/detail/gru_kernel.h diff --git a/paddle/operators/math/detail/lstm_cpu_kernel.h b/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h similarity index 100% rename from paddle/operators/math/detail/lstm_cpu_kernel.h rename to paddle/fluid/operators/math/detail/lstm_cpu_kernel.h diff --git a/paddle/operators/math/detail/lstm_gpu_kernel.h b/paddle/fluid/operators/math/detail/lstm_gpu_kernel.h similarity index 100% rename from paddle/operators/math/detail/lstm_gpu_kernel.h rename to paddle/fluid/operators/math/detail/lstm_gpu_kernel.h diff --git a/paddle/operators/math/detail/lstm_kernel.h b/paddle/fluid/operators/math/detail/lstm_kernel.h similarity index 100% rename from paddle/operators/math/detail/lstm_kernel.h rename to paddle/fluid/operators/math/detail/lstm_kernel.h diff --git a/paddle/operators/math/detection_util.h b/paddle/fluid/operators/math/detection_util.h similarity index 100% rename from paddle/operators/math/detection_util.h rename to paddle/fluid/operators/math/detection_util.h diff --git a/paddle/operators/math/gru_compute.cc b/paddle/fluid/operators/math/gru_compute.cc similarity index 100% rename from paddle/operators/math/gru_compute.cc rename to paddle/fluid/operators/math/gru_compute.cc diff --git a/paddle/operators/math/gru_compute.cu b/paddle/fluid/operators/math/gru_compute.cu similarity index 100% rename from paddle/operators/math/gru_compute.cu rename to paddle/fluid/operators/math/gru_compute.cu diff --git a/paddle/operators/math/gru_compute.h b/paddle/fluid/operators/math/gru_compute.h similarity index 100% rename from paddle/operators/math/gru_compute.h rename to paddle/fluid/operators/math/gru_compute.h diff --git a/paddle/operators/math/im2col.cc b/paddle/fluid/operators/math/im2col.cc similarity index 100% rename from paddle/operators/math/im2col.cc rename to paddle/fluid/operators/math/im2col.cc diff --git a/paddle/operators/math/im2col.cu b/paddle/fluid/operators/math/im2col.cu similarity index 100% rename from paddle/operators/math/im2col.cu rename to paddle/fluid/operators/math/im2col.cu diff --git a/paddle/operators/math/im2col.h b/paddle/fluid/operators/math/im2col.h similarity index 100% rename from paddle/operators/math/im2col.h rename to paddle/fluid/operators/math/im2col.h diff --git a/paddle/operators/math/im2col_test.cc b/paddle/fluid/operators/math/im2col_test.cc similarity index 100% rename from paddle/operators/math/im2col_test.cc rename to paddle/fluid/operators/math/im2col_test.cc diff --git a/paddle/operators/math/lstm_compute.cc b/paddle/fluid/operators/math/lstm_compute.cc similarity index 100% rename from paddle/operators/math/lstm_compute.cc rename to paddle/fluid/operators/math/lstm_compute.cc diff --git a/paddle/operators/math/lstm_compute.cu b/paddle/fluid/operators/math/lstm_compute.cu similarity index 100% rename from paddle/operators/math/lstm_compute.cu rename to paddle/fluid/operators/math/lstm_compute.cu diff --git a/paddle/operators/math/lstm_compute.h b/paddle/fluid/operators/math/lstm_compute.h similarity index 100% rename from paddle/operators/math/lstm_compute.h rename to paddle/fluid/operators/math/lstm_compute.h diff --git a/paddle/operators/math/math_function.cc b/paddle/fluid/operators/math/math_function.cc similarity index 100% rename from paddle/operators/math/math_function.cc rename to paddle/fluid/operators/math/math_function.cc diff --git a/paddle/operators/math/math_function.cu b/paddle/fluid/operators/math/math_function.cu similarity index 100% rename from paddle/operators/math/math_function.cu rename to paddle/fluid/operators/math/math_function.cu diff --git a/paddle/operators/math/math_function.h b/paddle/fluid/operators/math/math_function.h similarity index 100% rename from paddle/operators/math/math_function.h rename to paddle/fluid/operators/math/math_function.h diff --git a/paddle/operators/math/math_function_impl.h b/paddle/fluid/operators/math/math_function_impl.h similarity index 100% rename from paddle/operators/math/math_function_impl.h rename to paddle/fluid/operators/math/math_function_impl.h diff --git a/paddle/operators/math/math_function_test.cc b/paddle/fluid/operators/math/math_function_test.cc similarity index 100% rename from paddle/operators/math/math_function_test.cc rename to paddle/fluid/operators/math/math_function_test.cc diff --git a/paddle/operators/math/math_function_test.cu b/paddle/fluid/operators/math/math_function_test.cu similarity index 100% rename from paddle/operators/math/math_function_test.cu rename to paddle/fluid/operators/math/math_function_test.cu diff --git a/paddle/operators/math/matmul.h b/paddle/fluid/operators/math/matmul.h similarity index 100% rename from paddle/operators/math/matmul.h rename to paddle/fluid/operators/math/matmul.h diff --git a/paddle/operators/math/maxouting.cc b/paddle/fluid/operators/math/maxouting.cc similarity index 100% rename from paddle/operators/math/maxouting.cc rename to paddle/fluid/operators/math/maxouting.cc diff --git a/paddle/operators/math/maxouting.cu b/paddle/fluid/operators/math/maxouting.cu similarity index 100% rename from paddle/operators/math/maxouting.cu rename to paddle/fluid/operators/math/maxouting.cu diff --git a/paddle/operators/math/maxouting.h b/paddle/fluid/operators/math/maxouting.h similarity index 100% rename from paddle/operators/math/maxouting.h rename to paddle/fluid/operators/math/maxouting.h diff --git a/paddle/operators/math/pooling.cc b/paddle/fluid/operators/math/pooling.cc similarity index 100% rename from paddle/operators/math/pooling.cc rename to paddle/fluid/operators/math/pooling.cc diff --git a/paddle/operators/math/pooling.cu b/paddle/fluid/operators/math/pooling.cu similarity index 100% rename from paddle/operators/math/pooling.cu rename to paddle/fluid/operators/math/pooling.cu diff --git a/paddle/operators/math/pooling.h b/paddle/fluid/operators/math/pooling.h similarity index 100% rename from paddle/operators/math/pooling.h rename to paddle/fluid/operators/math/pooling.h diff --git a/paddle/operators/math/sampler.cc b/paddle/fluid/operators/math/sampler.cc similarity index 100% rename from paddle/operators/math/sampler.cc rename to paddle/fluid/operators/math/sampler.cc diff --git a/paddle/operators/math/sampler.h b/paddle/fluid/operators/math/sampler.h similarity index 100% rename from paddle/operators/math/sampler.h rename to paddle/fluid/operators/math/sampler.h diff --git a/paddle/operators/math/selected_rows_functor.cc b/paddle/fluid/operators/math/selected_rows_functor.cc similarity index 100% rename from paddle/operators/math/selected_rows_functor.cc rename to paddle/fluid/operators/math/selected_rows_functor.cc diff --git a/paddle/operators/math/selected_rows_functor.cu b/paddle/fluid/operators/math/selected_rows_functor.cu similarity index 100% rename from paddle/operators/math/selected_rows_functor.cu rename to paddle/fluid/operators/math/selected_rows_functor.cu diff --git a/paddle/operators/math/selected_rows_functor.h b/paddle/fluid/operators/math/selected_rows_functor.h similarity index 100% rename from paddle/operators/math/selected_rows_functor.h rename to paddle/fluid/operators/math/selected_rows_functor.h diff --git a/paddle/operators/math/selected_rows_functor_test.cc b/paddle/fluid/operators/math/selected_rows_functor_test.cc similarity index 100% rename from paddle/operators/math/selected_rows_functor_test.cc rename to paddle/fluid/operators/math/selected_rows_functor_test.cc diff --git a/paddle/operators/math/selected_rows_functor_test.cu b/paddle/fluid/operators/math/selected_rows_functor_test.cu similarity index 100% rename from paddle/operators/math/selected_rows_functor_test.cu rename to paddle/fluid/operators/math/selected_rows_functor_test.cu diff --git a/paddle/operators/math/sequence2batch.cc b/paddle/fluid/operators/math/sequence2batch.cc similarity index 100% rename from paddle/operators/math/sequence2batch.cc rename to paddle/fluid/operators/math/sequence2batch.cc diff --git a/paddle/operators/math/sequence2batch.cu b/paddle/fluid/operators/math/sequence2batch.cu similarity index 100% rename from paddle/operators/math/sequence2batch.cu rename to paddle/fluid/operators/math/sequence2batch.cu diff --git a/paddle/operators/math/sequence2batch.h b/paddle/fluid/operators/math/sequence2batch.h similarity index 100% rename from paddle/operators/math/sequence2batch.h rename to paddle/fluid/operators/math/sequence2batch.h diff --git a/paddle/operators/math/sequence_padding.cc b/paddle/fluid/operators/math/sequence_padding.cc similarity index 100% rename from paddle/operators/math/sequence_padding.cc rename to paddle/fluid/operators/math/sequence_padding.cc diff --git a/paddle/operators/math/sequence_padding.cu b/paddle/fluid/operators/math/sequence_padding.cu similarity index 100% rename from paddle/operators/math/sequence_padding.cu rename to paddle/fluid/operators/math/sequence_padding.cu diff --git a/paddle/operators/math/sequence_padding.h b/paddle/fluid/operators/math/sequence_padding.h similarity index 100% rename from paddle/operators/math/sequence_padding.h rename to paddle/fluid/operators/math/sequence_padding.h diff --git a/paddle/operators/math/sequence_padding_test.cc b/paddle/fluid/operators/math/sequence_padding_test.cc similarity index 100% rename from paddle/operators/math/sequence_padding_test.cc rename to paddle/fluid/operators/math/sequence_padding_test.cc diff --git a/paddle/operators/math/sequence_pooling.cc b/paddle/fluid/operators/math/sequence_pooling.cc similarity index 100% rename from paddle/operators/math/sequence_pooling.cc rename to paddle/fluid/operators/math/sequence_pooling.cc diff --git a/paddle/operators/math/sequence_pooling.cu b/paddle/fluid/operators/math/sequence_pooling.cu similarity index 100% rename from paddle/operators/math/sequence_pooling.cu rename to paddle/fluid/operators/math/sequence_pooling.cu diff --git a/paddle/operators/math/sequence_pooling.h b/paddle/fluid/operators/math/sequence_pooling.h similarity index 100% rename from paddle/operators/math/sequence_pooling.h rename to paddle/fluid/operators/math/sequence_pooling.h diff --git a/paddle/operators/math/sequence_scale.cc b/paddle/fluid/operators/math/sequence_scale.cc similarity index 100% rename from paddle/operators/math/sequence_scale.cc rename to paddle/fluid/operators/math/sequence_scale.cc diff --git a/paddle/operators/math/sequence_scale.cu b/paddle/fluid/operators/math/sequence_scale.cu similarity index 100% rename from paddle/operators/math/sequence_scale.cu rename to paddle/fluid/operators/math/sequence_scale.cu diff --git a/paddle/operators/math/sequence_scale.h b/paddle/fluid/operators/math/sequence_scale.h similarity index 100% rename from paddle/operators/math/sequence_scale.h rename to paddle/fluid/operators/math/sequence_scale.h diff --git a/paddle/operators/math/softmax.cc b/paddle/fluid/operators/math/softmax.cc similarity index 100% rename from paddle/operators/math/softmax.cc rename to paddle/fluid/operators/math/softmax.cc diff --git a/paddle/operators/math/softmax.cu b/paddle/fluid/operators/math/softmax.cu similarity index 100% rename from paddle/operators/math/softmax.cu rename to paddle/fluid/operators/math/softmax.cu diff --git a/paddle/operators/math/softmax.h b/paddle/fluid/operators/math/softmax.h similarity index 100% rename from paddle/operators/math/softmax.h rename to paddle/fluid/operators/math/softmax.h diff --git a/paddle/operators/math/softmax_impl.h b/paddle/fluid/operators/math/softmax_impl.h similarity index 100% rename from paddle/operators/math/softmax_impl.h rename to paddle/fluid/operators/math/softmax_impl.h diff --git a/paddle/operators/math/unpooling.cc b/paddle/fluid/operators/math/unpooling.cc similarity index 100% rename from paddle/operators/math/unpooling.cc rename to paddle/fluid/operators/math/unpooling.cc diff --git a/paddle/operators/math/unpooling.cu b/paddle/fluid/operators/math/unpooling.cu similarity index 100% rename from paddle/operators/math/unpooling.cu rename to paddle/fluid/operators/math/unpooling.cu diff --git a/paddle/operators/math/unpooling.h b/paddle/fluid/operators/math/unpooling.h similarity index 100% rename from paddle/operators/math/unpooling.h rename to paddle/fluid/operators/math/unpooling.h diff --git a/paddle/operators/math/vol2col.cc b/paddle/fluid/operators/math/vol2col.cc similarity index 100% rename from paddle/operators/math/vol2col.cc rename to paddle/fluid/operators/math/vol2col.cc diff --git a/paddle/operators/math/vol2col.cu b/paddle/fluid/operators/math/vol2col.cu similarity index 100% rename from paddle/operators/math/vol2col.cu rename to paddle/fluid/operators/math/vol2col.cu diff --git a/paddle/operators/math/vol2col.h b/paddle/fluid/operators/math/vol2col.h similarity index 100% rename from paddle/operators/math/vol2col.h rename to paddle/fluid/operators/math/vol2col.h diff --git a/paddle/operators/math/vol2col_test.cc b/paddle/fluid/operators/math/vol2col_test.cc similarity index 100% rename from paddle/operators/math/vol2col_test.cc rename to paddle/fluid/operators/math/vol2col_test.cc diff --git a/paddle/operators/matmul_op.cc b/paddle/fluid/operators/matmul_op.cc similarity index 100% rename from paddle/operators/matmul_op.cc rename to paddle/fluid/operators/matmul_op.cc diff --git a/paddle/operators/matmul_op.cu.cc b/paddle/fluid/operators/matmul_op.cu.cc similarity index 100% rename from paddle/operators/matmul_op.cu.cc rename to paddle/fluid/operators/matmul_op.cu.cc diff --git a/paddle/operators/matmul_op.h b/paddle/fluid/operators/matmul_op.h similarity index 100% rename from paddle/operators/matmul_op.h rename to paddle/fluid/operators/matmul_op.h diff --git a/paddle/operators/max_sequence_len_op.cc b/paddle/fluid/operators/max_sequence_len_op.cc similarity index 100% rename from paddle/operators/max_sequence_len_op.cc rename to paddle/fluid/operators/max_sequence_len_op.cc diff --git a/paddle/operators/maxout_op.cc b/paddle/fluid/operators/maxout_op.cc similarity index 100% rename from paddle/operators/maxout_op.cc rename to paddle/fluid/operators/maxout_op.cc diff --git a/paddle/operators/maxout_op.cu.cc b/paddle/fluid/operators/maxout_op.cu.cc similarity index 100% rename from paddle/operators/maxout_op.cu.cc rename to paddle/fluid/operators/maxout_op.cu.cc diff --git a/paddle/operators/maxout_op.h b/paddle/fluid/operators/maxout_op.h similarity index 100% rename from paddle/operators/maxout_op.h rename to paddle/fluid/operators/maxout_op.h diff --git a/paddle/operators/mean_op.cc b/paddle/fluid/operators/mean_op.cc similarity index 100% rename from paddle/operators/mean_op.cc rename to paddle/fluid/operators/mean_op.cc diff --git a/paddle/operators/mean_op.cu b/paddle/fluid/operators/mean_op.cu similarity index 100% rename from paddle/operators/mean_op.cu rename to paddle/fluid/operators/mean_op.cu diff --git a/paddle/operators/mean_op.h b/paddle/fluid/operators/mean_op.h similarity index 100% rename from paddle/operators/mean_op.h rename to paddle/fluid/operators/mean_op.h diff --git a/paddle/operators/merge_lod_tensor_op.cc b/paddle/fluid/operators/merge_lod_tensor_op.cc similarity index 100% rename from paddle/operators/merge_lod_tensor_op.cc rename to paddle/fluid/operators/merge_lod_tensor_op.cc diff --git a/paddle/operators/mine_hard_examples_op.cc b/paddle/fluid/operators/mine_hard_examples_op.cc similarity index 100% rename from paddle/operators/mine_hard_examples_op.cc rename to paddle/fluid/operators/mine_hard_examples_op.cc diff --git a/paddle/operators/minus_op.cc b/paddle/fluid/operators/minus_op.cc similarity index 100% rename from paddle/operators/minus_op.cc rename to paddle/fluid/operators/minus_op.cc diff --git a/paddle/operators/minus_op.cu b/paddle/fluid/operators/minus_op.cu similarity index 100% rename from paddle/operators/minus_op.cu rename to paddle/fluid/operators/minus_op.cu diff --git a/paddle/operators/minus_op.h b/paddle/fluid/operators/minus_op.h similarity index 100% rename from paddle/operators/minus_op.h rename to paddle/fluid/operators/minus_op.h diff --git a/paddle/operators/modified_huber_loss_op.cc b/paddle/fluid/operators/modified_huber_loss_op.cc similarity index 100% rename from paddle/operators/modified_huber_loss_op.cc rename to paddle/fluid/operators/modified_huber_loss_op.cc diff --git a/paddle/operators/modified_huber_loss_op.cu b/paddle/fluid/operators/modified_huber_loss_op.cu similarity index 100% rename from paddle/operators/modified_huber_loss_op.cu rename to paddle/fluid/operators/modified_huber_loss_op.cu diff --git a/paddle/operators/modified_huber_loss_op.h b/paddle/fluid/operators/modified_huber_loss_op.h similarity index 100% rename from paddle/operators/modified_huber_loss_op.h rename to paddle/fluid/operators/modified_huber_loss_op.h diff --git a/paddle/operators/momentum_op.cc b/paddle/fluid/operators/momentum_op.cc similarity index 100% rename from paddle/operators/momentum_op.cc rename to paddle/fluid/operators/momentum_op.cc diff --git a/paddle/operators/momentum_op.cu b/paddle/fluid/operators/momentum_op.cu similarity index 100% rename from paddle/operators/momentum_op.cu rename to paddle/fluid/operators/momentum_op.cu diff --git a/paddle/operators/momentum_op.h b/paddle/fluid/operators/momentum_op.h similarity index 100% rename from paddle/operators/momentum_op.h rename to paddle/fluid/operators/momentum_op.h diff --git a/paddle/operators/mul_op.cc b/paddle/fluid/operators/mul_op.cc similarity index 100% rename from paddle/operators/mul_op.cc rename to paddle/fluid/operators/mul_op.cc diff --git a/paddle/operators/mul_op.cu.cc b/paddle/fluid/operators/mul_op.cu.cc similarity index 100% rename from paddle/operators/mul_op.cu.cc rename to paddle/fluid/operators/mul_op.cu.cc diff --git a/paddle/operators/mul_op.h b/paddle/fluid/operators/mul_op.h similarity index 100% rename from paddle/operators/mul_op.h rename to paddle/fluid/operators/mul_op.h diff --git a/paddle/operators/multiclass_nms_op.cc b/paddle/fluid/operators/multiclass_nms_op.cc similarity index 100% rename from paddle/operators/multiclass_nms_op.cc rename to paddle/fluid/operators/multiclass_nms_op.cc diff --git a/paddle/operators/multiplex_op.cc b/paddle/fluid/operators/multiplex_op.cc similarity index 100% rename from paddle/operators/multiplex_op.cc rename to paddle/fluid/operators/multiplex_op.cc diff --git a/paddle/operators/multiplex_op.cu b/paddle/fluid/operators/multiplex_op.cu similarity index 100% rename from paddle/operators/multiplex_op.cu rename to paddle/fluid/operators/multiplex_op.cu diff --git a/paddle/operators/multiplex_op.h b/paddle/fluid/operators/multiplex_op.h similarity index 100% rename from paddle/operators/multiplex_op.h rename to paddle/fluid/operators/multiplex_op.h diff --git a/paddle/operators/nccl/CMakeLists.txt b/paddle/fluid/operators/nccl/CMakeLists.txt similarity index 100% rename from paddle/operators/nccl/CMakeLists.txt rename to paddle/fluid/operators/nccl/CMakeLists.txt diff --git a/paddle/operators/nccl/nccl_gpu_common.cc b/paddle/fluid/operators/nccl/nccl_gpu_common.cc similarity index 100% rename from paddle/operators/nccl/nccl_gpu_common.cc rename to paddle/fluid/operators/nccl/nccl_gpu_common.cc diff --git a/paddle/operators/nccl/nccl_gpu_common.h b/paddle/fluid/operators/nccl/nccl_gpu_common.h similarity index 100% rename from paddle/operators/nccl/nccl_gpu_common.h rename to paddle/fluid/operators/nccl/nccl_gpu_common.h diff --git a/paddle/operators/nccl_op.cc b/paddle/fluid/operators/nccl_op.cc similarity index 100% rename from paddle/operators/nccl_op.cc rename to paddle/fluid/operators/nccl_op.cc diff --git a/paddle/operators/nccl_op.cu.cc b/paddle/fluid/operators/nccl_op.cu.cc similarity index 100% rename from paddle/operators/nccl_op.cu.cc rename to paddle/fluid/operators/nccl_op.cu.cc diff --git a/paddle/operators/nccl_op_test.cu.cc b/paddle/fluid/operators/nccl_op_test.cu.cc similarity index 100% rename from paddle/operators/nccl_op_test.cu.cc rename to paddle/fluid/operators/nccl_op_test.cu.cc diff --git a/paddle/operators/nce_op.cc b/paddle/fluid/operators/nce_op.cc similarity index 100% rename from paddle/operators/nce_op.cc rename to paddle/fluid/operators/nce_op.cc diff --git a/paddle/operators/nce_op.h b/paddle/fluid/operators/nce_op.h similarity index 100% rename from paddle/operators/nce_op.h rename to paddle/fluid/operators/nce_op.h diff --git a/paddle/operators/net_op.cc b/paddle/fluid/operators/net_op.cc similarity index 100% rename from paddle/operators/net_op.cc rename to paddle/fluid/operators/net_op.cc diff --git a/paddle/operators/net_op.h b/paddle/fluid/operators/net_op.h similarity index 100% rename from paddle/operators/net_op.h rename to paddle/fluid/operators/net_op.h diff --git a/paddle/operators/net_op_test.cc b/paddle/fluid/operators/net_op_test.cc similarity index 100% rename from paddle/operators/net_op_test.cc rename to paddle/fluid/operators/net_op_test.cc diff --git a/paddle/operators/norm_op.cc b/paddle/fluid/operators/norm_op.cc similarity index 100% rename from paddle/operators/norm_op.cc rename to paddle/fluid/operators/norm_op.cc diff --git a/paddle/operators/norm_op.cu b/paddle/fluid/operators/norm_op.cu similarity index 100% rename from paddle/operators/norm_op.cu rename to paddle/fluid/operators/norm_op.cu diff --git a/paddle/operators/norm_op.h b/paddle/fluid/operators/norm_op.h similarity index 100% rename from paddle/operators/norm_op.h rename to paddle/fluid/operators/norm_op.h diff --git a/paddle/operators/one_hot_op.cc b/paddle/fluid/operators/one_hot_op.cc similarity index 100% rename from paddle/operators/one_hot_op.cc rename to paddle/fluid/operators/one_hot_op.cc diff --git a/paddle/operators/one_hot_op.cu b/paddle/fluid/operators/one_hot_op.cu similarity index 100% rename from paddle/operators/one_hot_op.cu rename to paddle/fluid/operators/one_hot_op.cu diff --git a/paddle/operators/one_hot_op.h b/paddle/fluid/operators/one_hot_op.h similarity index 100% rename from paddle/operators/one_hot_op.h rename to paddle/fluid/operators/one_hot_op.h diff --git a/paddle/operators/op_documentation/batch_norm_op.md b/paddle/fluid/operators/op_documentation/batch_norm_op.md similarity index 100% rename from paddle/operators/op_documentation/batch_norm_op.md rename to paddle/fluid/operators/op_documentation/batch_norm_op.md diff --git a/paddle/operators/op_documentation/name_convention.md b/paddle/fluid/operators/op_documentation/name_convention.md similarity index 100% rename from paddle/operators/op_documentation/name_convention.md rename to paddle/fluid/operators/op_documentation/name_convention.md diff --git a/paddle/operators/op_documentation/net_op_design.md b/paddle/fluid/operators/op_documentation/net_op_design.md similarity index 100% rename from paddle/operators/op_documentation/net_op_design.md rename to paddle/fluid/operators/op_documentation/net_op_design.md diff --git a/paddle/operators/op_documentation/op_markdown_format.md b/paddle/fluid/operators/op_documentation/op_markdown_format.md similarity index 100% rename from paddle/operators/op_documentation/op_markdown_format.md rename to paddle/fluid/operators/op_documentation/op_markdown_format.md diff --git a/paddle/operators/op_documentation/rnn_design.md b/paddle/fluid/operators/op_documentation/rnn_design.md similarity index 100% rename from paddle/operators/op_documentation/rnn_design.md rename to paddle/fluid/operators/op_documentation/rnn_design.md diff --git a/paddle/operators/pad_op.cc b/paddle/fluid/operators/pad_op.cc similarity index 100% rename from paddle/operators/pad_op.cc rename to paddle/fluid/operators/pad_op.cc diff --git a/paddle/operators/pad_op.cu b/paddle/fluid/operators/pad_op.cu similarity index 100% rename from paddle/operators/pad_op.cu rename to paddle/fluid/operators/pad_op.cu diff --git a/paddle/operators/pad_op.h b/paddle/fluid/operators/pad_op.h similarity index 100% rename from paddle/operators/pad_op.h rename to paddle/fluid/operators/pad_op.h diff --git a/paddle/operators/parallel_do_op.cc b/paddle/fluid/operators/parallel_do_op.cc similarity index 100% rename from paddle/operators/parallel_do_op.cc rename to paddle/fluid/operators/parallel_do_op.cc diff --git a/paddle/operators/pool_cudnn_op.cu.cc b/paddle/fluid/operators/pool_cudnn_op.cu.cc similarity index 100% rename from paddle/operators/pool_cudnn_op.cu.cc rename to paddle/fluid/operators/pool_cudnn_op.cu.cc diff --git a/paddle/operators/pool_op.cc b/paddle/fluid/operators/pool_op.cc similarity index 100% rename from paddle/operators/pool_op.cc rename to paddle/fluid/operators/pool_op.cc diff --git a/paddle/operators/pool_op.cu.cc b/paddle/fluid/operators/pool_op.cu.cc similarity index 100% rename from paddle/operators/pool_op.cu.cc rename to paddle/fluid/operators/pool_op.cu.cc diff --git a/paddle/operators/pool_op.h b/paddle/fluid/operators/pool_op.h similarity index 100% rename from paddle/operators/pool_op.h rename to paddle/fluid/operators/pool_op.h diff --git a/paddle/operators/pool_with_index_op.cc b/paddle/fluid/operators/pool_with_index_op.cc similarity index 100% rename from paddle/operators/pool_with_index_op.cc rename to paddle/fluid/operators/pool_with_index_op.cc diff --git a/paddle/operators/pool_with_index_op.cu.cc b/paddle/fluid/operators/pool_with_index_op.cu.cc similarity index 100% rename from paddle/operators/pool_with_index_op.cu.cc rename to paddle/fluid/operators/pool_with_index_op.cu.cc diff --git a/paddle/operators/pool_with_index_op.h b/paddle/fluid/operators/pool_with_index_op.h similarity index 100% rename from paddle/operators/pool_with_index_op.h rename to paddle/fluid/operators/pool_with_index_op.h diff --git a/paddle/operators/positive_negative_pair_op.cc b/paddle/fluid/operators/positive_negative_pair_op.cc similarity index 100% rename from paddle/operators/positive_negative_pair_op.cc rename to paddle/fluid/operators/positive_negative_pair_op.cc diff --git a/paddle/operators/positive_negative_pair_op.h b/paddle/fluid/operators/positive_negative_pair_op.h similarity index 100% rename from paddle/operators/positive_negative_pair_op.h rename to paddle/fluid/operators/positive_negative_pair_op.h diff --git a/paddle/operators/precision_recall_op.cc b/paddle/fluid/operators/precision_recall_op.cc similarity index 100% rename from paddle/operators/precision_recall_op.cc rename to paddle/fluid/operators/precision_recall_op.cc diff --git a/paddle/operators/precision_recall_op.h b/paddle/fluid/operators/precision_recall_op.h similarity index 100% rename from paddle/operators/precision_recall_op.h rename to paddle/fluid/operators/precision_recall_op.h diff --git a/paddle/operators/prelu_op.cc b/paddle/fluid/operators/prelu_op.cc similarity index 100% rename from paddle/operators/prelu_op.cc rename to paddle/fluid/operators/prelu_op.cc diff --git a/paddle/operators/prelu_op.cu b/paddle/fluid/operators/prelu_op.cu similarity index 100% rename from paddle/operators/prelu_op.cu rename to paddle/fluid/operators/prelu_op.cu diff --git a/paddle/operators/prelu_op.h b/paddle/fluid/operators/prelu_op.h similarity index 100% rename from paddle/operators/prelu_op.h rename to paddle/fluid/operators/prelu_op.h diff --git a/paddle/operators/print_op.cc b/paddle/fluid/operators/print_op.cc similarity index 100% rename from paddle/operators/print_op.cc rename to paddle/fluid/operators/print_op.cc diff --git a/paddle/operators/prior_box_op.cc b/paddle/fluid/operators/prior_box_op.cc similarity index 100% rename from paddle/operators/prior_box_op.cc rename to paddle/fluid/operators/prior_box_op.cc diff --git a/paddle/operators/prior_box_op.h b/paddle/fluid/operators/prior_box_op.h similarity index 100% rename from paddle/operators/prior_box_op.h rename to paddle/fluid/operators/prior_box_op.h diff --git a/paddle/operators/proximal_adagrad_op.cc b/paddle/fluid/operators/proximal_adagrad_op.cc similarity index 100% rename from paddle/operators/proximal_adagrad_op.cc rename to paddle/fluid/operators/proximal_adagrad_op.cc diff --git a/paddle/operators/proximal_adagrad_op.cu b/paddle/fluid/operators/proximal_adagrad_op.cu similarity index 100% rename from paddle/operators/proximal_adagrad_op.cu rename to paddle/fluid/operators/proximal_adagrad_op.cu diff --git a/paddle/operators/proximal_adagrad_op.h b/paddle/fluid/operators/proximal_adagrad_op.h similarity index 100% rename from paddle/operators/proximal_adagrad_op.h rename to paddle/fluid/operators/proximal_adagrad_op.h diff --git a/paddle/operators/proximal_gd_op.cc b/paddle/fluid/operators/proximal_gd_op.cc similarity index 100% rename from paddle/operators/proximal_gd_op.cc rename to paddle/fluid/operators/proximal_gd_op.cc diff --git a/paddle/operators/proximal_gd_op.cu b/paddle/fluid/operators/proximal_gd_op.cu similarity index 100% rename from paddle/operators/proximal_gd_op.cu rename to paddle/fluid/operators/proximal_gd_op.cu diff --git a/paddle/operators/proximal_gd_op.h b/paddle/fluid/operators/proximal_gd_op.h similarity index 100% rename from paddle/operators/proximal_gd_op.h rename to paddle/fluid/operators/proximal_gd_op.h diff --git a/paddle/operators/rank_loss_op.cc b/paddle/fluid/operators/rank_loss_op.cc similarity index 100% rename from paddle/operators/rank_loss_op.cc rename to paddle/fluid/operators/rank_loss_op.cc diff --git a/paddle/operators/rank_loss_op.cu b/paddle/fluid/operators/rank_loss_op.cu similarity index 100% rename from paddle/operators/rank_loss_op.cu rename to paddle/fluid/operators/rank_loss_op.cu diff --git a/paddle/operators/rank_loss_op.h b/paddle/fluid/operators/rank_loss_op.h similarity index 100% rename from paddle/operators/rank_loss_op.h rename to paddle/fluid/operators/rank_loss_op.h diff --git a/paddle/operators/read_op.cc b/paddle/fluid/operators/read_op.cc similarity index 100% rename from paddle/operators/read_op.cc rename to paddle/fluid/operators/read_op.cc diff --git a/paddle/operators/recurrent_op.cc b/paddle/fluid/operators/recurrent_op.cc similarity index 100% rename from paddle/operators/recurrent_op.cc rename to paddle/fluid/operators/recurrent_op.cc diff --git a/paddle/operators/recv_op.cc b/paddle/fluid/operators/recv_op.cc similarity index 100% rename from paddle/operators/recv_op.cc rename to paddle/fluid/operators/recv_op.cc diff --git a/paddle/operators/reduce_op.cc b/paddle/fluid/operators/reduce_op.cc similarity index 100% rename from paddle/operators/reduce_op.cc rename to paddle/fluid/operators/reduce_op.cc diff --git a/paddle/operators/reduce_op.cu b/paddle/fluid/operators/reduce_op.cu similarity index 100% rename from paddle/operators/reduce_op.cu rename to paddle/fluid/operators/reduce_op.cu diff --git a/paddle/operators/reduce_op.h b/paddle/fluid/operators/reduce_op.h similarity index 100% rename from paddle/operators/reduce_op.h rename to paddle/fluid/operators/reduce_op.h diff --git a/paddle/operators/reorder_lod_tensor_by_rank_op.cc b/paddle/fluid/operators/reorder_lod_tensor_by_rank_op.cc similarity index 100% rename from paddle/operators/reorder_lod_tensor_by_rank_op.cc rename to paddle/fluid/operators/reorder_lod_tensor_by_rank_op.cc diff --git a/paddle/operators/reshape_op.cc b/paddle/fluid/operators/reshape_op.cc similarity index 100% rename from paddle/operators/reshape_op.cc rename to paddle/fluid/operators/reshape_op.cc diff --git a/paddle/operators/reshape_op.cu b/paddle/fluid/operators/reshape_op.cu similarity index 100% rename from paddle/operators/reshape_op.cu rename to paddle/fluid/operators/reshape_op.cu diff --git a/paddle/operators/reshape_op.h b/paddle/fluid/operators/reshape_op.h similarity index 100% rename from paddle/operators/reshape_op.h rename to paddle/fluid/operators/reshape_op.h diff --git a/paddle/operators/rmsprop_op.cc b/paddle/fluid/operators/rmsprop_op.cc similarity index 100% rename from paddle/operators/rmsprop_op.cc rename to paddle/fluid/operators/rmsprop_op.cc diff --git a/paddle/operators/rmsprop_op.cu b/paddle/fluid/operators/rmsprop_op.cu similarity index 100% rename from paddle/operators/rmsprop_op.cu rename to paddle/fluid/operators/rmsprop_op.cu diff --git a/paddle/operators/rmsprop_op.h b/paddle/fluid/operators/rmsprop_op.h similarity index 100% rename from paddle/operators/rmsprop_op.h rename to paddle/fluid/operators/rmsprop_op.h diff --git a/paddle/operators/rnn_memory_helper_op.cc b/paddle/fluid/operators/rnn_memory_helper_op.cc similarity index 100% rename from paddle/operators/rnn_memory_helper_op.cc rename to paddle/fluid/operators/rnn_memory_helper_op.cc diff --git a/paddle/operators/roi_pool_op.cc b/paddle/fluid/operators/roi_pool_op.cc similarity index 100% rename from paddle/operators/roi_pool_op.cc rename to paddle/fluid/operators/roi_pool_op.cc diff --git a/paddle/operators/roi_pool_op.cu b/paddle/fluid/operators/roi_pool_op.cu similarity index 100% rename from paddle/operators/roi_pool_op.cu rename to paddle/fluid/operators/roi_pool_op.cu diff --git a/paddle/operators/roi_pool_op.h b/paddle/fluid/operators/roi_pool_op.h similarity index 100% rename from paddle/operators/roi_pool_op.h rename to paddle/fluid/operators/roi_pool_op.h diff --git a/paddle/operators/row_conv_op.cc b/paddle/fluid/operators/row_conv_op.cc similarity index 100% rename from paddle/operators/row_conv_op.cc rename to paddle/fluid/operators/row_conv_op.cc diff --git a/paddle/operators/row_conv_op.cu b/paddle/fluid/operators/row_conv_op.cu similarity index 100% rename from paddle/operators/row_conv_op.cu rename to paddle/fluid/operators/row_conv_op.cu diff --git a/paddle/operators/row_conv_op.h b/paddle/fluid/operators/row_conv_op.h similarity index 100% rename from paddle/operators/row_conv_op.h rename to paddle/fluid/operators/row_conv_op.h diff --git a/paddle/operators/save_combine_op.cc b/paddle/fluid/operators/save_combine_op.cc similarity index 100% rename from paddle/operators/save_combine_op.cc rename to paddle/fluid/operators/save_combine_op.cc diff --git a/paddle/operators/save_load_combine_op_test.cc b/paddle/fluid/operators/save_load_combine_op_test.cc similarity index 100% rename from paddle/operators/save_load_combine_op_test.cc rename to paddle/fluid/operators/save_load_combine_op_test.cc diff --git a/paddle/operators/save_load_op_test.cc b/paddle/fluid/operators/save_load_op_test.cc similarity index 100% rename from paddle/operators/save_load_op_test.cc rename to paddle/fluid/operators/save_load_op_test.cc diff --git a/paddle/operators/save_op.cc b/paddle/fluid/operators/save_op.cc similarity index 100% rename from paddle/operators/save_op.cc rename to paddle/fluid/operators/save_op.cc diff --git a/paddle/operators/scale_op.cc b/paddle/fluid/operators/scale_op.cc similarity index 100% rename from paddle/operators/scale_op.cc rename to paddle/fluid/operators/scale_op.cc diff --git a/paddle/operators/scale_op.cu b/paddle/fluid/operators/scale_op.cu similarity index 100% rename from paddle/operators/scale_op.cu rename to paddle/fluid/operators/scale_op.cu diff --git a/paddle/operators/scale_op.h b/paddle/fluid/operators/scale_op.h similarity index 100% rename from paddle/operators/scale_op.h rename to paddle/fluid/operators/scale_op.h diff --git a/paddle/operators/scatter.cu.h b/paddle/fluid/operators/scatter.cu.h similarity index 100% rename from paddle/operators/scatter.cu.h rename to paddle/fluid/operators/scatter.cu.h diff --git a/paddle/operators/scatter.h b/paddle/fluid/operators/scatter.h similarity index 100% rename from paddle/operators/scatter.h rename to paddle/fluid/operators/scatter.h diff --git a/paddle/operators/scatter_op.cc b/paddle/fluid/operators/scatter_op.cc similarity index 100% rename from paddle/operators/scatter_op.cc rename to paddle/fluid/operators/scatter_op.cc diff --git a/paddle/operators/scatter_op.cu b/paddle/fluid/operators/scatter_op.cu similarity index 100% rename from paddle/operators/scatter_op.cu rename to paddle/fluid/operators/scatter_op.cu diff --git a/paddle/operators/scatter_op.h b/paddle/fluid/operators/scatter_op.h similarity index 100% rename from paddle/operators/scatter_op.h rename to paddle/fluid/operators/scatter_op.h diff --git a/paddle/operators/scatter_test.cc b/paddle/fluid/operators/scatter_test.cc similarity index 100% rename from paddle/operators/scatter_test.cc rename to paddle/fluid/operators/scatter_test.cc diff --git a/paddle/operators/send_op.cc b/paddle/fluid/operators/send_op.cc similarity index 100% rename from paddle/operators/send_op.cc rename to paddle/fluid/operators/send_op.cc diff --git a/paddle/operators/send_recv_op_test.cc b/paddle/fluid/operators/send_recv_op_test.cc similarity index 100% rename from paddle/operators/send_recv_op_test.cc rename to paddle/fluid/operators/send_recv_op_test.cc diff --git a/paddle/operators/sequence_concat_op.cc b/paddle/fluid/operators/sequence_concat_op.cc similarity index 100% rename from paddle/operators/sequence_concat_op.cc rename to paddle/fluid/operators/sequence_concat_op.cc diff --git a/paddle/operators/sequence_concat_op.cu.cc b/paddle/fluid/operators/sequence_concat_op.cu.cc similarity index 100% rename from paddle/operators/sequence_concat_op.cu.cc rename to paddle/fluid/operators/sequence_concat_op.cu.cc diff --git a/paddle/operators/sequence_concat_op.h b/paddle/fluid/operators/sequence_concat_op.h similarity index 100% rename from paddle/operators/sequence_concat_op.h rename to paddle/fluid/operators/sequence_concat_op.h diff --git a/paddle/operators/sequence_conv_op.cc b/paddle/fluid/operators/sequence_conv_op.cc similarity index 100% rename from paddle/operators/sequence_conv_op.cc rename to paddle/fluid/operators/sequence_conv_op.cc diff --git a/paddle/operators/sequence_conv_op.cu.cc b/paddle/fluid/operators/sequence_conv_op.cu.cc similarity index 100% rename from paddle/operators/sequence_conv_op.cu.cc rename to paddle/fluid/operators/sequence_conv_op.cu.cc diff --git a/paddle/operators/sequence_conv_op.h b/paddle/fluid/operators/sequence_conv_op.h similarity index 100% rename from paddle/operators/sequence_conv_op.h rename to paddle/fluid/operators/sequence_conv_op.h diff --git a/paddle/operators/sequence_erase_op.cc b/paddle/fluid/operators/sequence_erase_op.cc similarity index 100% rename from paddle/operators/sequence_erase_op.cc rename to paddle/fluid/operators/sequence_erase_op.cc diff --git a/paddle/operators/sequence_erase_op.cu b/paddle/fluid/operators/sequence_erase_op.cu similarity index 100% rename from paddle/operators/sequence_erase_op.cu rename to paddle/fluid/operators/sequence_erase_op.cu diff --git a/paddle/operators/sequence_erase_op.h b/paddle/fluid/operators/sequence_erase_op.h similarity index 100% rename from paddle/operators/sequence_erase_op.h rename to paddle/fluid/operators/sequence_erase_op.h diff --git a/paddle/operators/sequence_expand_op.cc b/paddle/fluid/operators/sequence_expand_op.cc similarity index 100% rename from paddle/operators/sequence_expand_op.cc rename to paddle/fluid/operators/sequence_expand_op.cc diff --git a/paddle/operators/sequence_expand_op.cu b/paddle/fluid/operators/sequence_expand_op.cu similarity index 100% rename from paddle/operators/sequence_expand_op.cu rename to paddle/fluid/operators/sequence_expand_op.cu diff --git a/paddle/operators/sequence_expand_op.h b/paddle/fluid/operators/sequence_expand_op.h similarity index 100% rename from paddle/operators/sequence_expand_op.h rename to paddle/fluid/operators/sequence_expand_op.h diff --git a/paddle/operators/sequence_pool_op.cc b/paddle/fluid/operators/sequence_pool_op.cc similarity index 100% rename from paddle/operators/sequence_pool_op.cc rename to paddle/fluid/operators/sequence_pool_op.cc diff --git a/paddle/operators/sequence_pool_op.cu b/paddle/fluid/operators/sequence_pool_op.cu similarity index 100% rename from paddle/operators/sequence_pool_op.cu rename to paddle/fluid/operators/sequence_pool_op.cu diff --git a/paddle/operators/sequence_pool_op.h b/paddle/fluid/operators/sequence_pool_op.h similarity index 100% rename from paddle/operators/sequence_pool_op.h rename to paddle/fluid/operators/sequence_pool_op.h diff --git a/paddle/operators/sequence_reshape_op.cc b/paddle/fluid/operators/sequence_reshape_op.cc similarity index 100% rename from paddle/operators/sequence_reshape_op.cc rename to paddle/fluid/operators/sequence_reshape_op.cc diff --git a/paddle/operators/sequence_reshape_op.cu b/paddle/fluid/operators/sequence_reshape_op.cu similarity index 100% rename from paddle/operators/sequence_reshape_op.cu rename to paddle/fluid/operators/sequence_reshape_op.cu diff --git a/paddle/operators/sequence_reshape_op.h b/paddle/fluid/operators/sequence_reshape_op.h similarity index 100% rename from paddle/operators/sequence_reshape_op.h rename to paddle/fluid/operators/sequence_reshape_op.h diff --git a/paddle/operators/sequence_slice_op.cc b/paddle/fluid/operators/sequence_slice_op.cc similarity index 100% rename from paddle/operators/sequence_slice_op.cc rename to paddle/fluid/operators/sequence_slice_op.cc diff --git a/paddle/operators/sequence_slice_op.cu b/paddle/fluid/operators/sequence_slice_op.cu similarity index 100% rename from paddle/operators/sequence_slice_op.cu rename to paddle/fluid/operators/sequence_slice_op.cu diff --git a/paddle/operators/sequence_slice_op.h b/paddle/fluid/operators/sequence_slice_op.h similarity index 100% rename from paddle/operators/sequence_slice_op.h rename to paddle/fluid/operators/sequence_slice_op.h diff --git a/paddle/operators/sequence_softmax_op.cc b/paddle/fluid/operators/sequence_softmax_op.cc similarity index 100% rename from paddle/operators/sequence_softmax_op.cc rename to paddle/fluid/operators/sequence_softmax_op.cc diff --git a/paddle/operators/sequence_softmax_op.cu.cc b/paddle/fluid/operators/sequence_softmax_op.cu.cc similarity index 100% rename from paddle/operators/sequence_softmax_op.cu.cc rename to paddle/fluid/operators/sequence_softmax_op.cu.cc diff --git a/paddle/operators/sequence_softmax_op.h b/paddle/fluid/operators/sequence_softmax_op.h similarity index 100% rename from paddle/operators/sequence_softmax_op.h rename to paddle/fluid/operators/sequence_softmax_op.h diff --git a/paddle/operators/sgd_op.cc b/paddle/fluid/operators/sgd_op.cc similarity index 100% rename from paddle/operators/sgd_op.cc rename to paddle/fluid/operators/sgd_op.cc diff --git a/paddle/operators/sgd_op.cu b/paddle/fluid/operators/sgd_op.cu similarity index 100% rename from paddle/operators/sgd_op.cu rename to paddle/fluid/operators/sgd_op.cu diff --git a/paddle/operators/sgd_op.h b/paddle/fluid/operators/sgd_op.h similarity index 100% rename from paddle/operators/sgd_op.h rename to paddle/fluid/operators/sgd_op.h diff --git a/paddle/operators/shrink_rnn_memory_op.cc b/paddle/fluid/operators/shrink_rnn_memory_op.cc similarity index 100% rename from paddle/operators/shrink_rnn_memory_op.cc rename to paddle/fluid/operators/shrink_rnn_memory_op.cc diff --git a/paddle/operators/sigmoid_cross_entropy_with_logits_op.cc b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cc similarity index 100% rename from paddle/operators/sigmoid_cross_entropy_with_logits_op.cc rename to paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cc diff --git a/paddle/operators/sigmoid_cross_entropy_with_logits_op.cu b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cu similarity index 100% rename from paddle/operators/sigmoid_cross_entropy_with_logits_op.cu rename to paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cu diff --git a/paddle/operators/sigmoid_cross_entropy_with_logits_op.h b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h similarity index 100% rename from paddle/operators/sigmoid_cross_entropy_with_logits_op.h rename to paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h diff --git a/paddle/operators/sign_op.cc b/paddle/fluid/operators/sign_op.cc similarity index 100% rename from paddle/operators/sign_op.cc rename to paddle/fluid/operators/sign_op.cc diff --git a/paddle/operators/sign_op.cu b/paddle/fluid/operators/sign_op.cu similarity index 100% rename from paddle/operators/sign_op.cu rename to paddle/fluid/operators/sign_op.cu diff --git a/paddle/operators/sign_op.h b/paddle/fluid/operators/sign_op.h similarity index 100% rename from paddle/operators/sign_op.h rename to paddle/fluid/operators/sign_op.h diff --git a/paddle/operators/smooth_l1_loss_op.cc b/paddle/fluid/operators/smooth_l1_loss_op.cc similarity index 100% rename from paddle/operators/smooth_l1_loss_op.cc rename to paddle/fluid/operators/smooth_l1_loss_op.cc diff --git a/paddle/operators/smooth_l1_loss_op.cu b/paddle/fluid/operators/smooth_l1_loss_op.cu similarity index 100% rename from paddle/operators/smooth_l1_loss_op.cu rename to paddle/fluid/operators/smooth_l1_loss_op.cu diff --git a/paddle/operators/smooth_l1_loss_op.h b/paddle/fluid/operators/smooth_l1_loss_op.h similarity index 100% rename from paddle/operators/smooth_l1_loss_op.h rename to paddle/fluid/operators/smooth_l1_loss_op.h diff --git a/paddle/operators/softmax_op.cc b/paddle/fluid/operators/softmax_op.cc similarity index 100% rename from paddle/operators/softmax_op.cc rename to paddle/fluid/operators/softmax_op.cc diff --git a/paddle/operators/softmax_op.cu.cc b/paddle/fluid/operators/softmax_op.cu.cc similarity index 100% rename from paddle/operators/softmax_op.cu.cc rename to paddle/fluid/operators/softmax_op.cu.cc diff --git a/paddle/operators/softmax_op.h b/paddle/fluid/operators/softmax_op.h similarity index 100% rename from paddle/operators/softmax_op.h rename to paddle/fluid/operators/softmax_op.h diff --git a/paddle/operators/softmax_with_cross_entropy_op.cc b/paddle/fluid/operators/softmax_with_cross_entropy_op.cc similarity index 100% rename from paddle/operators/softmax_with_cross_entropy_op.cc rename to paddle/fluid/operators/softmax_with_cross_entropy_op.cc diff --git a/paddle/operators/softmax_with_cross_entropy_op.cu b/paddle/fluid/operators/softmax_with_cross_entropy_op.cu similarity index 100% rename from paddle/operators/softmax_with_cross_entropy_op.cu rename to paddle/fluid/operators/softmax_with_cross_entropy_op.cu diff --git a/paddle/operators/softmax_with_cross_entropy_op.h b/paddle/fluid/operators/softmax_with_cross_entropy_op.h similarity index 100% rename from paddle/operators/softmax_with_cross_entropy_op.h rename to paddle/fluid/operators/softmax_with_cross_entropy_op.h diff --git a/paddle/operators/split_lod_tensor_op.cc b/paddle/fluid/operators/split_lod_tensor_op.cc similarity index 100% rename from paddle/operators/split_lod_tensor_op.cc rename to paddle/fluid/operators/split_lod_tensor_op.cc diff --git a/paddle/operators/split_op.cc b/paddle/fluid/operators/split_op.cc similarity index 100% rename from paddle/operators/split_op.cc rename to paddle/fluid/operators/split_op.cc diff --git a/paddle/operators/split_op.cu.cc b/paddle/fluid/operators/split_op.cu.cc similarity index 100% rename from paddle/operators/split_op.cu.cc rename to paddle/fluid/operators/split_op.cu.cc diff --git a/paddle/operators/split_op.h b/paddle/fluid/operators/split_op.h similarity index 100% rename from paddle/operators/split_op.h rename to paddle/fluid/operators/split_op.h diff --git a/paddle/operators/split_selected_rows_op.cc b/paddle/fluid/operators/split_selected_rows_op.cc similarity index 100% rename from paddle/operators/split_selected_rows_op.cc rename to paddle/fluid/operators/split_selected_rows_op.cc diff --git a/paddle/operators/split_selected_rows_op.cu b/paddle/fluid/operators/split_selected_rows_op.cu similarity index 100% rename from paddle/operators/split_selected_rows_op.cu rename to paddle/fluid/operators/split_selected_rows_op.cu diff --git a/paddle/operators/split_selected_rows_op.h b/paddle/fluid/operators/split_selected_rows_op.h similarity index 100% rename from paddle/operators/split_selected_rows_op.h rename to paddle/fluid/operators/split_selected_rows_op.h diff --git a/paddle/operators/spp_op.cc b/paddle/fluid/operators/spp_op.cc similarity index 100% rename from paddle/operators/spp_op.cc rename to paddle/fluid/operators/spp_op.cc diff --git a/paddle/operators/spp_op.cu.cc b/paddle/fluid/operators/spp_op.cu.cc similarity index 100% rename from paddle/operators/spp_op.cu.cc rename to paddle/fluid/operators/spp_op.cu.cc diff --git a/paddle/operators/spp_op.h b/paddle/fluid/operators/spp_op.h similarity index 100% rename from paddle/operators/spp_op.h rename to paddle/fluid/operators/spp_op.h diff --git a/paddle/operators/squared_l2_distance_op.cc b/paddle/fluid/operators/squared_l2_distance_op.cc similarity index 100% rename from paddle/operators/squared_l2_distance_op.cc rename to paddle/fluid/operators/squared_l2_distance_op.cc diff --git a/paddle/operators/squared_l2_distance_op.cu b/paddle/fluid/operators/squared_l2_distance_op.cu similarity index 100% rename from paddle/operators/squared_l2_distance_op.cu rename to paddle/fluid/operators/squared_l2_distance_op.cu diff --git a/paddle/operators/squared_l2_distance_op.h b/paddle/fluid/operators/squared_l2_distance_op.h similarity index 100% rename from paddle/operators/squared_l2_distance_op.h rename to paddle/fluid/operators/squared_l2_distance_op.h diff --git a/paddle/operators/squared_l2_norm_op.cc b/paddle/fluid/operators/squared_l2_norm_op.cc similarity index 100% rename from paddle/operators/squared_l2_norm_op.cc rename to paddle/fluid/operators/squared_l2_norm_op.cc diff --git a/paddle/operators/squared_l2_norm_op.cu b/paddle/fluid/operators/squared_l2_norm_op.cu similarity index 100% rename from paddle/operators/squared_l2_norm_op.cu rename to paddle/fluid/operators/squared_l2_norm_op.cu diff --git a/paddle/operators/squared_l2_norm_op.h b/paddle/fluid/operators/squared_l2_norm_op.h similarity index 100% rename from paddle/operators/squared_l2_norm_op.h rename to paddle/fluid/operators/squared_l2_norm_op.h diff --git a/paddle/operators/strided_memcpy.h b/paddle/fluid/operators/strided_memcpy.h similarity index 100% rename from paddle/operators/strided_memcpy.h rename to paddle/fluid/operators/strided_memcpy.h diff --git a/paddle/operators/strided_memcpy_test.cc b/paddle/fluid/operators/strided_memcpy_test.cc similarity index 100% rename from paddle/operators/strided_memcpy_test.cc rename to paddle/fluid/operators/strided_memcpy_test.cc diff --git a/paddle/operators/sum_op.cc b/paddle/fluid/operators/sum_op.cc similarity index 100% rename from paddle/operators/sum_op.cc rename to paddle/fluid/operators/sum_op.cc diff --git a/paddle/operators/sum_op.cu b/paddle/fluid/operators/sum_op.cu similarity index 100% rename from paddle/operators/sum_op.cu rename to paddle/fluid/operators/sum_op.cu diff --git a/paddle/operators/sum_op.h b/paddle/fluid/operators/sum_op.h similarity index 100% rename from paddle/operators/sum_op.h rename to paddle/fluid/operators/sum_op.h diff --git a/paddle/operators/target_assign_op.cc b/paddle/fluid/operators/target_assign_op.cc similarity index 100% rename from paddle/operators/target_assign_op.cc rename to paddle/fluid/operators/target_assign_op.cc diff --git a/paddle/operators/target_assign_op.cu b/paddle/fluid/operators/target_assign_op.cu similarity index 100% rename from paddle/operators/target_assign_op.cu rename to paddle/fluid/operators/target_assign_op.cu diff --git a/paddle/operators/target_assign_op.h b/paddle/fluid/operators/target_assign_op.h similarity index 100% rename from paddle/operators/target_assign_op.h rename to paddle/fluid/operators/target_assign_op.h diff --git a/paddle/operators/tensor_array_read_write_op.cc b/paddle/fluid/operators/tensor_array_read_write_op.cc similarity index 100% rename from paddle/operators/tensor_array_read_write_op.cc rename to paddle/fluid/operators/tensor_array_read_write_op.cc diff --git a/paddle/operators/top_k_op.cc b/paddle/fluid/operators/top_k_op.cc similarity index 100% rename from paddle/operators/top_k_op.cc rename to paddle/fluid/operators/top_k_op.cc diff --git a/paddle/operators/top_k_op.cu b/paddle/fluid/operators/top_k_op.cu similarity index 100% rename from paddle/operators/top_k_op.cu rename to paddle/fluid/operators/top_k_op.cu diff --git a/paddle/operators/top_k_op.h b/paddle/fluid/operators/top_k_op.h similarity index 100% rename from paddle/operators/top_k_op.h rename to paddle/fluid/operators/top_k_op.h diff --git a/paddle/operators/transpose_op.cc b/paddle/fluid/operators/transpose_op.cc similarity index 100% rename from paddle/operators/transpose_op.cc rename to paddle/fluid/operators/transpose_op.cc diff --git a/paddle/operators/transpose_op.cu.cc b/paddle/fluid/operators/transpose_op.cu.cc similarity index 100% rename from paddle/operators/transpose_op.cu.cc rename to paddle/fluid/operators/transpose_op.cu.cc diff --git a/paddle/operators/transpose_op.h b/paddle/fluid/operators/transpose_op.h similarity index 100% rename from paddle/operators/transpose_op.h rename to paddle/fluid/operators/transpose_op.h diff --git a/paddle/operators/uniform_random_op.cc b/paddle/fluid/operators/uniform_random_op.cc similarity index 100% rename from paddle/operators/uniform_random_op.cc rename to paddle/fluid/operators/uniform_random_op.cc diff --git a/paddle/operators/uniform_random_op.cu b/paddle/fluid/operators/uniform_random_op.cu similarity index 100% rename from paddle/operators/uniform_random_op.cu rename to paddle/fluid/operators/uniform_random_op.cu diff --git a/paddle/operators/unpool_op.cc b/paddle/fluid/operators/unpool_op.cc similarity index 100% rename from paddle/operators/unpool_op.cc rename to paddle/fluid/operators/unpool_op.cc diff --git a/paddle/operators/unpool_op.cu.cc b/paddle/fluid/operators/unpool_op.cu.cc similarity index 100% rename from paddle/operators/unpool_op.cu.cc rename to paddle/fluid/operators/unpool_op.cu.cc diff --git a/paddle/operators/unpool_op.h b/paddle/fluid/operators/unpool_op.h similarity index 100% rename from paddle/operators/unpool_op.h rename to paddle/fluid/operators/unpool_op.h diff --git a/paddle/operators/warpctc_op.cc b/paddle/fluid/operators/warpctc_op.cc similarity index 100% rename from paddle/operators/warpctc_op.cc rename to paddle/fluid/operators/warpctc_op.cc diff --git a/paddle/operators/warpctc_op.cu.cc b/paddle/fluid/operators/warpctc_op.cu.cc similarity index 100% rename from paddle/operators/warpctc_op.cu.cc rename to paddle/fluid/operators/warpctc_op.cu.cc diff --git a/paddle/operators/warpctc_op.h b/paddle/fluid/operators/warpctc_op.h similarity index 100% rename from paddle/operators/warpctc_op.h rename to paddle/fluid/operators/warpctc_op.h diff --git a/paddle/operators/while_op.cc b/paddle/fluid/operators/while_op.cc similarity index 100% rename from paddle/operators/while_op.cc rename to paddle/fluid/operators/while_op.cc diff --git a/paddle/platform/.clang-format b/paddle/fluid/platform/.clang-format similarity index 100% rename from paddle/platform/.clang-format rename to paddle/fluid/platform/.clang-format diff --git a/paddle/platform/CMakeLists.txt b/paddle/fluid/platform/CMakeLists.txt similarity index 100% rename from paddle/platform/CMakeLists.txt rename to paddle/fluid/platform/CMakeLists.txt diff --git a/paddle/platform/assert.h b/paddle/fluid/platform/assert.h similarity index 100% rename from paddle/platform/assert.h rename to paddle/fluid/platform/assert.h diff --git a/paddle/platform/call_once.h b/paddle/fluid/platform/call_once.h similarity index 100% rename from paddle/platform/call_once.h rename to paddle/fluid/platform/call_once.h diff --git a/paddle/platform/cpu_info.cc b/paddle/fluid/platform/cpu_info.cc similarity index 100% rename from paddle/platform/cpu_info.cc rename to paddle/fluid/platform/cpu_info.cc diff --git a/paddle/platform/cpu_info.h b/paddle/fluid/platform/cpu_info.h similarity index 100% rename from paddle/platform/cpu_info.h rename to paddle/fluid/platform/cpu_info.h diff --git a/paddle/platform/cpu_info_test.cc b/paddle/fluid/platform/cpu_info_test.cc similarity index 100% rename from paddle/platform/cpu_info_test.cc rename to paddle/fluid/platform/cpu_info_test.cc diff --git a/paddle/platform/cuda_helper.h b/paddle/fluid/platform/cuda_helper.h similarity index 100% rename from paddle/platform/cuda_helper.h rename to paddle/fluid/platform/cuda_helper.h diff --git a/paddle/platform/cuda_profiler.h b/paddle/fluid/platform/cuda_profiler.h similarity index 100% rename from paddle/platform/cuda_profiler.h rename to paddle/fluid/platform/cuda_profiler.h diff --git a/paddle/platform/cudnn_helper.h b/paddle/fluid/platform/cudnn_helper.h similarity index 100% rename from paddle/platform/cudnn_helper.h rename to paddle/fluid/platform/cudnn_helper.h diff --git a/paddle/platform/cudnn_helper_test.cc b/paddle/fluid/platform/cudnn_helper_test.cc similarity index 100% rename from paddle/platform/cudnn_helper_test.cc rename to paddle/fluid/platform/cudnn_helper_test.cc diff --git a/paddle/platform/details/device_ptr_cast.h b/paddle/fluid/platform/details/device_ptr_cast.h similarity index 100% rename from paddle/platform/details/device_ptr_cast.h rename to paddle/fluid/platform/details/device_ptr_cast.h diff --git a/paddle/platform/device_context.cc b/paddle/fluid/platform/device_context.cc similarity index 100% rename from paddle/platform/device_context.cc rename to paddle/fluid/platform/device_context.cc diff --git a/paddle/platform/device_context.h b/paddle/fluid/platform/device_context.h similarity index 100% rename from paddle/platform/device_context.h rename to paddle/fluid/platform/device_context.h diff --git a/paddle/platform/device_context_test.cu b/paddle/fluid/platform/device_context_test.cu similarity index 100% rename from paddle/platform/device_context_test.cu rename to paddle/fluid/platform/device_context_test.cu diff --git a/paddle/platform/dynload/CMakeLists.txt b/paddle/fluid/platform/dynload/CMakeLists.txt similarity index 100% rename from paddle/platform/dynload/CMakeLists.txt rename to paddle/fluid/platform/dynload/CMakeLists.txt diff --git a/paddle/platform/dynload/cublas.cc b/paddle/fluid/platform/dynload/cublas.cc similarity index 100% rename from paddle/platform/dynload/cublas.cc rename to paddle/fluid/platform/dynload/cublas.cc diff --git a/paddle/platform/dynload/cublas.h b/paddle/fluid/platform/dynload/cublas.h similarity index 100% rename from paddle/platform/dynload/cublas.h rename to paddle/fluid/platform/dynload/cublas.h diff --git a/paddle/platform/dynload/cudnn.cc b/paddle/fluid/platform/dynload/cudnn.cc similarity index 100% rename from paddle/platform/dynload/cudnn.cc rename to paddle/fluid/platform/dynload/cudnn.cc diff --git a/paddle/platform/dynload/cudnn.h b/paddle/fluid/platform/dynload/cudnn.h similarity index 100% rename from paddle/platform/dynload/cudnn.h rename to paddle/fluid/platform/dynload/cudnn.h diff --git a/paddle/platform/dynload/curand.cc b/paddle/fluid/platform/dynload/curand.cc similarity index 100% rename from paddle/platform/dynload/curand.cc rename to paddle/fluid/platform/dynload/curand.cc diff --git a/paddle/platform/dynload/curand.h b/paddle/fluid/platform/dynload/curand.h similarity index 100% rename from paddle/platform/dynload/curand.h rename to paddle/fluid/platform/dynload/curand.h diff --git a/paddle/platform/dynload/dynamic_loader.cc b/paddle/fluid/platform/dynload/dynamic_loader.cc similarity index 100% rename from paddle/platform/dynload/dynamic_loader.cc rename to paddle/fluid/platform/dynload/dynamic_loader.cc diff --git a/paddle/platform/dynload/dynamic_loader.h b/paddle/fluid/platform/dynload/dynamic_loader.h similarity index 100% rename from paddle/platform/dynload/dynamic_loader.h rename to paddle/fluid/platform/dynload/dynamic_loader.h diff --git a/paddle/platform/dynload/nccl.cc b/paddle/fluid/platform/dynload/nccl.cc similarity index 100% rename from paddle/platform/dynload/nccl.cc rename to paddle/fluid/platform/dynload/nccl.cc diff --git a/paddle/platform/dynload/nccl.h b/paddle/fluid/platform/dynload/nccl.h similarity index 100% rename from paddle/platform/dynload/nccl.h rename to paddle/fluid/platform/dynload/nccl.h diff --git a/paddle/platform/dynload/warpctc.cc b/paddle/fluid/platform/dynload/warpctc.cc similarity index 100% rename from paddle/platform/dynload/warpctc.cc rename to paddle/fluid/platform/dynload/warpctc.cc diff --git a/paddle/platform/dynload/warpctc.h b/paddle/fluid/platform/dynload/warpctc.h similarity index 100% rename from paddle/platform/dynload/warpctc.h rename to paddle/fluid/platform/dynload/warpctc.h diff --git a/paddle/platform/enforce.cc b/paddle/fluid/platform/enforce.cc similarity index 100% rename from paddle/platform/enforce.cc rename to paddle/fluid/platform/enforce.cc diff --git a/paddle/platform/enforce.h b/paddle/fluid/platform/enforce.h similarity index 100% rename from paddle/platform/enforce.h rename to paddle/fluid/platform/enforce.h diff --git a/paddle/platform/enforce_test.cc b/paddle/fluid/platform/enforce_test.cc similarity index 100% rename from paddle/platform/enforce_test.cc rename to paddle/fluid/platform/enforce_test.cc diff --git a/paddle/platform/for_range.h b/paddle/fluid/platform/for_range.h similarity index 100% rename from paddle/platform/for_range.h rename to paddle/fluid/platform/for_range.h diff --git a/paddle/platform/gpu_info.cc b/paddle/fluid/platform/gpu_info.cc similarity index 100% rename from paddle/platform/gpu_info.cc rename to paddle/fluid/platform/gpu_info.cc diff --git a/paddle/platform/gpu_info.h b/paddle/fluid/platform/gpu_info.h similarity index 100% rename from paddle/platform/gpu_info.h rename to paddle/fluid/platform/gpu_info.h diff --git a/paddle/platform/hostdevice.h b/paddle/fluid/platform/hostdevice.h similarity index 100% rename from paddle/platform/hostdevice.h rename to paddle/fluid/platform/hostdevice.h diff --git a/paddle/platform/macros.h b/paddle/fluid/platform/macros.h similarity index 100% rename from paddle/platform/macros.h rename to paddle/fluid/platform/macros.h diff --git a/paddle/platform/mkldnn_helper.h b/paddle/fluid/platform/mkldnn_helper.h similarity index 100% rename from paddle/platform/mkldnn_helper.h rename to paddle/fluid/platform/mkldnn_helper.h diff --git a/paddle/platform/nccl_test.cu b/paddle/fluid/platform/nccl_test.cu similarity index 100% rename from paddle/platform/nccl_test.cu rename to paddle/fluid/platform/nccl_test.cu diff --git a/paddle/platform/place.cc b/paddle/fluid/platform/place.cc similarity index 100% rename from paddle/platform/place.cc rename to paddle/fluid/platform/place.cc diff --git a/paddle/platform/place.h b/paddle/fluid/platform/place.h similarity index 100% rename from paddle/platform/place.h rename to paddle/fluid/platform/place.h diff --git a/paddle/platform/place_test.cc b/paddle/fluid/platform/place_test.cc similarity index 100% rename from paddle/platform/place_test.cc rename to paddle/fluid/platform/place_test.cc diff --git a/paddle/platform/profiler.cc b/paddle/fluid/platform/profiler.cc similarity index 100% rename from paddle/platform/profiler.cc rename to paddle/fluid/platform/profiler.cc diff --git a/paddle/platform/profiler.h b/paddle/fluid/platform/profiler.h similarity index 100% rename from paddle/platform/profiler.h rename to paddle/fluid/platform/profiler.h diff --git a/paddle/platform/profiler_test.cc b/paddle/fluid/platform/profiler_test.cc similarity index 100% rename from paddle/platform/profiler_test.cc rename to paddle/fluid/platform/profiler_test.cc diff --git a/paddle/platform/transform.h b/paddle/fluid/platform/transform.h similarity index 100% rename from paddle/platform/transform.h rename to paddle/fluid/platform/transform.h diff --git a/paddle/platform/transform_test.cu b/paddle/fluid/platform/transform_test.cu similarity index 100% rename from paddle/platform/transform_test.cu rename to paddle/fluid/platform/transform_test.cu diff --git a/paddle/platform/variant.h b/paddle/fluid/platform/variant.h similarity index 100% rename from paddle/platform/variant.h rename to paddle/fluid/platform/variant.h diff --git a/paddle/pybind/.clang-format b/paddle/fluid/pybind/.clang-format similarity index 100% rename from paddle/pybind/.clang-format rename to paddle/fluid/pybind/.clang-format diff --git a/paddle/pybind/CMakeLists.txt b/paddle/fluid/pybind/CMakeLists.txt similarity index 100% rename from paddle/pybind/CMakeLists.txt rename to paddle/fluid/pybind/CMakeLists.txt diff --git a/paddle/pybind/const_value.cc b/paddle/fluid/pybind/const_value.cc similarity index 100% rename from paddle/pybind/const_value.cc rename to paddle/fluid/pybind/const_value.cc diff --git a/paddle/pybind/const_value.h b/paddle/fluid/pybind/const_value.h similarity index 100% rename from paddle/pybind/const_value.h rename to paddle/fluid/pybind/const_value.h diff --git a/paddle/pybind/exception.cc b/paddle/fluid/pybind/exception.cc similarity index 100% rename from paddle/pybind/exception.cc rename to paddle/fluid/pybind/exception.cc diff --git a/paddle/pybind/exception.h b/paddle/fluid/pybind/exception.h similarity index 100% rename from paddle/pybind/exception.h rename to paddle/fluid/pybind/exception.h diff --git a/paddle/pybind/protobuf.cc b/paddle/fluid/pybind/protobuf.cc similarity index 100% rename from paddle/pybind/protobuf.cc rename to paddle/fluid/pybind/protobuf.cc diff --git a/paddle/pybind/protobuf.h b/paddle/fluid/pybind/protobuf.h similarity index 100% rename from paddle/pybind/protobuf.h rename to paddle/fluid/pybind/protobuf.h diff --git a/paddle/pybind/pybind.cc b/paddle/fluid/pybind/pybind.cc similarity index 100% rename from paddle/pybind/pybind.cc rename to paddle/fluid/pybind/pybind.cc diff --git a/paddle/pybind/tensor_py.h b/paddle/fluid/pybind/tensor_py.h similarity index 100% rename from paddle/pybind/tensor_py.h rename to paddle/fluid/pybind/tensor_py.h -- GitLab From fc374821ddb9d40daaaf443c3d78ac2d3643ce03 Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 9 Feb 2018 17:18:35 -0800 Subject: [PATCH 45/55] Correct #include path --- paddle/fluid/framework/attribute.cc | 2 +- paddle/fluid/framework/attribute.h | 6 +- paddle/fluid/framework/backward.cc | 10 +- paddle/fluid/framework/backward.h | 4 +- paddle/fluid/framework/backward_test.cc | 12 +- paddle/fluid/framework/block_desc.cc | 6 +- paddle/fluid/framework/block_desc.h | 8 +- paddle/fluid/framework/channel.h | 4 +- paddle/fluid/framework/channel_test.cc | 2 +- .../fluid/framework/data_device_transform.cc | 2 +- .../fluid/framework/data_device_transform.h | 8 +- .../framework/data_device_transform_test.cu | 14 +- paddle/fluid/framework/data_layout.h | 2 +- .../fluid/framework/data_layout_transform.cc | 4 +- .../fluid/framework/data_layout_transform.h | 6 +- .../framework/data_layout_transform_test.cc | 4 +- paddle/fluid/framework/data_transform.cc | 8 +- paddle/fluid/framework/data_transform.h | 16 +-- paddle/fluid/framework/data_type.h | 4 +- paddle/fluid/framework/data_type_transform.cc | 6 +- paddle/fluid/framework/data_type_transform.h | 8 +- .../framework/data_type_transform_test.cc | 2 +- paddle/fluid/framework/ddim.cc | 4 +- paddle/fluid/framework/ddim.h | 6 +- paddle/fluid/framework/ddim_test.cc | 2 +- .../framework/details/buffered_channel.h | 4 +- .../fluid/framework/details/cow_ptr_test.cc | 2 +- paddle/fluid/framework/details/op_registry.h | 10 +- .../framework/details/unbuffered_channel.h | 2 +- paddle/fluid/framework/dim.h | 4 +- paddle/fluid/framework/dim_test.cu | 2 +- paddle/fluid/framework/eigen.h | 2 +- paddle/fluid/framework/eigen_test.cc | 2 +- paddle/fluid/framework/executor.cc | 18 +-- paddle/fluid/framework/executor.h | 10 +- paddle/fluid/framework/feed_fetch_method.cc | 4 +- paddle/fluid/framework/feed_fetch_method.h | 4 +- paddle/fluid/framework/feed_fetch_type.h | 2 +- paddle/fluid/framework/grad_op_desc_maker.h | 4 +- paddle/fluid/framework/init.cc | 8 +- paddle/fluid/framework/init_test.cc | 4 +- paddle/fluid/framework/lod_rank_table.cc | 2 +- paddle/fluid/framework/lod_rank_table.h | 2 +- paddle/fluid/framework/lod_tensor.cc | 10 +- paddle/fluid/framework/lod_tensor.h | 12 +- paddle/fluid/framework/lod_tensor_array.h | 2 +- paddle/fluid/framework/lod_tensor_test.cc | 2 +- paddle/fluid/framework/lod_tensor_test.cu | 10 +- paddle/fluid/framework/mixed_vector.h | 4 +- paddle/fluid/framework/mixed_vector_test.cu | 4 +- paddle/fluid/framework/op_desc.cc | 10 +- paddle/fluid/framework/op_desc.h | 6 +- paddle/fluid/framework/op_info.cc | 2 +- paddle/fluid/framework/op_info.h | 6 +- paddle/fluid/framework/op_kernel_type.h | 10 +- paddle/fluid/framework/op_kernel_type_test.cc | 2 +- paddle/fluid/framework/op_proto_maker.cc | 2 +- paddle/fluid/framework/op_proto_maker.h | 4 +- paddle/fluid/framework/op_proto_maker_test.cc | 2 +- paddle/fluid/framework/op_registry.cc | 2 +- paddle/fluid/framework/op_registry.h | 16 +-- paddle/fluid/framework/op_registry_test.cc | 2 +- paddle/fluid/framework/operator.cc | 10 +- paddle/fluid/framework/operator.h | 22 ++-- paddle/fluid/framework/operator_test.cc | 8 +- paddle/fluid/framework/program_desc.cc | 6 +- paddle/fluid/framework/program_desc.h | 8 +- paddle/fluid/framework/program_desc_test.cc | 4 +- paddle/fluid/framework/prune.cc | 2 +- paddle/fluid/framework/prune.h | 4 +- paddle/fluid/framework/prune_test.cc | 14 +- paddle/fluid/framework/reader.cc | 2 +- paddle/fluid/framework/reader.h | 4 +- paddle/fluid/framework/scope.cc | 4 +- paddle/fluid/framework/scope.h | 4 +- paddle/fluid/framework/scope_test.cc | 2 +- paddle/fluid/framework/selected_rows.cc | 2 +- paddle/fluid/framework/selected_rows.h | 4 +- paddle/fluid/framework/selected_rows_test.cc | 2 +- paddle/fluid/framework/shape_inference.cc | 4 +- paddle/fluid/framework/shape_inference.h | 6 +- paddle/fluid/framework/tensor.cc | 2 +- paddle/fluid/framework/tensor.h | 14 +- paddle/fluid/framework/tensor_impl.h | 4 +- paddle/fluid/framework/tensor_test.cc | 2 +- paddle/fluid/framework/tensor_util.cc | 2 +- paddle/fluid/framework/tensor_util.cu | 120 +++++++++++++++++- paddle/fluid/framework/tensor_util.h | 10 +- paddle/fluid/framework/tensor_util_test.cc | 2 +- paddle/fluid/framework/tensor_util_test.cu | 6 +- paddle/fluid/framework/threadpool.cc | 4 +- paddle/fluid/framework/threadpool.h | 4 +- paddle/fluid/framework/type_defs.h | 2 +- paddle/fluid/framework/var_desc.cc | 4 +- paddle/fluid/framework/var_desc.h | 2 +- paddle/fluid/framework/var_type.h | 14 +- paddle/fluid/framework/var_type_inference.h | 2 +- .../framework/var_type_inference_test.cc | 8 +- paddle/fluid/framework/variable.h | 2 +- paddle/fluid/framework/variable_test.cc | 2 +- paddle/fluid/inference/io.cc | 6 +- paddle/fluid/inference/io.h | 6 +- .../fluid/inference/tests/book/test_helper.h | 4 +- paddle/fluid/memory/.clang-format | 6 +- paddle/fluid/memory/detail/buddy_allocator.cc | 2 +- paddle/fluid/memory/detail/buddy_allocator.h | 12 +- paddle/fluid/memory/detail/memory_block.cc | 8 +- paddle/fluid/memory/detail/meta_cache.cc | 6 +- paddle/fluid/memory/detail/meta_cache.h | 4 +- paddle/fluid/memory/detail/meta_data.cc | 2 +- paddle/fluid/memory/detail/meta_data.h | 2 +- .../fluid/memory/detail/system_allocator.cc | 8 +- .../memory/detail/system_allocator_test.cc | 2 +- paddle/fluid/memory/memcpy.cc | 2 +- paddle/fluid/memory/memcpy.h | 4 +- paddle/fluid/memory/memory.cc | 8 +- paddle/fluid/memory/memory.h | 2 +- paddle/fluid/memory/memory_test.cc | 12 +- paddle/fluid/operators/.clang-format | 6 +- paddle/fluid/operators/accuracy_op.cc | 2 +- paddle/fluid/operators/accuracy_op.cu | 6 +- paddle/fluid/operators/accuracy_op.h | 2 +- paddle/fluid/operators/activation_op.cc | 2 +- paddle/fluid/operators/activation_op.cu | 2 +- paddle/fluid/operators/activation_op.h | 6 +- paddle/fluid/operators/adadelta_op.cc | 2 +- paddle/fluid/operators/adadelta_op.cu | 2 +- paddle/fluid/operators/adadelta_op.h | 4 +- paddle/fluid/operators/adagrad_op.cc | 6 +- paddle/fluid/operators/adagrad_op.cu | 8 +- paddle/fluid/operators/adagrad_op.h | 4 +- paddle/fluid/operators/adam_op.cc | 2 +- paddle/fluid/operators/adam_op.cu | 2 +- paddle/fluid/operators/adam_op.h | 8 +- paddle/fluid/operators/adamax_op.cc | 2 +- paddle/fluid/operators/adamax_op.cu | 2 +- paddle/fluid/operators/adamax_op.h | 4 +- paddle/fluid/operators/array_operator.h | 6 +- .../fluid/operators/array_to_lod_tensor_op.cc | 10 +- paddle/fluid/operators/assign_op.cc | 8 +- paddle/fluid/operators/assign_value_op.cc | 2 +- paddle/fluid/operators/assign_value_op.cu.cc | 2 +- paddle/fluid/operators/assign_value_op.h | 6 +- paddle/fluid/operators/auc_op.cc | 2 +- paddle/fluid/operators/auc_op.h | 4 +- paddle/fluid/operators/batch_norm_op.cc | 4 +- paddle/fluid/operators/batch_norm_op.cu.cc | 8 +- paddle/fluid/operators/batch_norm_op.h | 4 +- .../fluid/operators/beam_search_decode_op.cc | 4 +- .../fluid/operators/beam_search_decode_op.h | 4 +- .../operators/beam_search_decode_op_test.cc | 2 +- paddle/fluid/operators/beam_search_op.cc | 6 +- paddle/fluid/operators/beam_search_op.h | 4 +- paddle/fluid/operators/beam_search_op_test.cc | 2 +- .../operators/bilinear_tensor_product_op.cc | 2 +- .../operators/bilinear_tensor_product_op.cu | 2 +- .../operators/bilinear_tensor_product_op.h | 6 +- paddle/fluid/operators/bipartite_match_op.cc | 4 +- paddle/fluid/operators/box_coder_op.cc | 2 +- paddle/fluid/operators/box_coder_op.cu | 4 +- paddle/fluid/operators/box_coder_op.h | 4 +- paddle/fluid/operators/cast_op.cc | 4 +- paddle/fluid/operators/cast_op.cu | 2 +- paddle/fluid/operators/cast_op.h | 8 +- paddle/fluid/operators/chunk_eval_op.cc | 2 +- paddle/fluid/operators/chunk_eval_op.h | 4 +- paddle/fluid/operators/clip_by_norm_op.cc | 2 +- paddle/fluid/operators/clip_by_norm_op.cu | 2 +- paddle/fluid/operators/clip_by_norm_op.h | 6 +- paddle/fluid/operators/clip_op.cc | 2 +- paddle/fluid/operators/clip_op.cu | 2 +- paddle/fluid/operators/clip_op.h | 6 +- paddle/fluid/operators/compare_op.cc | 4 +- paddle/fluid/operators/compare_op.cu | 2 +- paddle/fluid/operators/compare_op.h | 6 +- paddle/fluid/operators/concat_op.cc | 2 +- paddle/fluid/operators/concat_op.cu.cc | 2 +- paddle/fluid/operators/concat_op.h | 4 +- paddle/fluid/operators/cond_op.cc | 8 +- paddle/fluid/operators/cond_op.h | 10 +- .../fluid/operators/conditional_block_op.cc | 4 +- paddle/fluid/operators/conv_cudnn_op.cu.cc | 12 +- paddle/fluid/operators/conv_op.cc | 2 +- paddle/fluid/operators/conv_op.cu.cc | 2 +- paddle/fluid/operators/conv_op.h | 12 +- paddle/fluid/operators/conv_shift_op.cc | 4 +- paddle/fluid/operators/conv_shift_op.cu | 6 +- paddle/fluid/operators/conv_shift_op.h | 2 +- .../operators/conv_transpose_cudnn_op.cu.cc | 12 +- paddle/fluid/operators/conv_transpose_op.cc | 2 +- .../fluid/operators/conv_transpose_op.cu.cc | 2 +- paddle/fluid/operators/conv_transpose_op.h | 10 +- paddle/fluid/operators/cos_sim_op.cc | 2 +- paddle/fluid/operators/cos_sim_op.cu | 2 +- paddle/fluid/operators/cos_sim_op.h | 8 +- paddle/fluid/operators/create_reader_op.cc | 4 +- paddle/fluid/operators/crf_decoding_op.cc | 2 +- paddle/fluid/operators/crf_decoding_op.h | 6 +- paddle/fluid/operators/crop_op.cc | 2 +- paddle/fluid/operators/crop_op.cu | 2 +- paddle/fluid/operators/crop_op.h | 6 +- paddle/fluid/operators/cross_entropy_op.cc | 2 +- paddle/fluid/operators/cross_entropy_op.cu | 2 +- paddle/fluid/operators/cross_entropy_op.h | 8 +- paddle/fluid/operators/ctc_align_op.cc | 2 +- paddle/fluid/operators/ctc_align_op.cu | 2 +- paddle/fluid/operators/ctc_align_op.h | 4 +- paddle/fluid/operators/cum_op.h | 8 +- paddle/fluid/operators/cumsum_op.cc | 2 +- paddle/fluid/operators/cumsum_op.cu | 2 +- paddle/fluid/operators/decayed_adagrad_op.cc | 2 +- paddle/fluid/operators/decayed_adagrad_op.cu | 2 +- paddle/fluid/operators/decayed_adagrad_op.h | 4 +- paddle/fluid/operators/detail/grpc_client.cc | 2 +- paddle/fluid/operators/detail/grpc_client.h | 12 +- paddle/fluid/operators/detail/grpc_server.cc | 2 +- paddle/fluid/operators/detail/grpc_server.h | 16 +-- .../operators/detail/sendrecvop_utils.cc | 2 +- .../fluid/operators/detail/sendrecvop_utils.h | 16 +-- .../fluid/operators/detail/strided_memcpy.h | 6 +- paddle/fluid/operators/detection_output_op.cc | 2 +- .../fluid/operators/detection_output_op.cu.cc | 2 +- paddle/fluid/operators/detection_output_op.h | 12 +- paddle/fluid/operators/dropout_op.cc | 2 +- paddle/fluid/operators/dropout_op.cu | 2 +- paddle/fluid/operators/dropout_op.h | 4 +- paddle/fluid/operators/edit_distance_op.cc | 2 +- paddle/fluid/operators/edit_distance_op.cu | 8 +- paddle/fluid/operators/edit_distance_op.h | 4 +- paddle/fluid/operators/elementwise_add_op.cc | 4 +- paddle/fluid/operators/elementwise_add_op.cu | 2 +- paddle/fluid/operators/elementwise_add_op.h | 2 +- paddle/fluid/operators/elementwise_div_op.cc | 4 +- paddle/fluid/operators/elementwise_div_op.cu | 2 +- paddle/fluid/operators/elementwise_div_op.h | 2 +- paddle/fluid/operators/elementwise_max_op.cc | 4 +- paddle/fluid/operators/elementwise_max_op.cu | 2 +- paddle/fluid/operators/elementwise_max_op.h | 2 +- paddle/fluid/operators/elementwise_min_op.cc | 4 +- paddle/fluid/operators/elementwise_min_op.cu | 2 +- paddle/fluid/operators/elementwise_min_op.h | 2 +- paddle/fluid/operators/elementwise_mul_op.cc | 4 +- paddle/fluid/operators/elementwise_mul_op.cu | 2 +- paddle/fluid/operators/elementwise_mul_op.h | 2 +- paddle/fluid/operators/elementwise_op.h | 4 +- .../fluid/operators/elementwise_op_function.h | 10 +- paddle/fluid/operators/elementwise_pow_op.cc | 4 +- paddle/fluid/operators/elementwise_pow_op.cu | 2 +- paddle/fluid/operators/elementwise_pow_op.h | 2 +- paddle/fluid/operators/elementwise_sub_op.cc | 4 +- paddle/fluid/operators/elementwise_sub_op.cu | 2 +- paddle/fluid/operators/elementwise_sub_op.h | 2 +- paddle/fluid/operators/expand_op.cc | 2 +- paddle/fluid/operators/expand_op.cu | 2 +- paddle/fluid/operators/expand_op.h | 6 +- paddle/fluid/operators/feed_op.cc | 6 +- paddle/fluid/operators/fetch_op.cc | 6 +- .../fill_constant_batch_size_like_op.cc | 2 +- .../fill_constant_batch_size_like_op.cu.cc | 4 +- .../fill_constant_batch_size_like_op.h | 4 +- paddle/fluid/operators/fill_constant_op.cc | 8 +- paddle/fluid/operators/fill_op.cc | 8 +- paddle/fluid/operators/fill_zeros_like_op.cc | 2 +- .../fluid/operators/fill_zeros_like_op.cu.cc | 4 +- paddle/fluid/operators/fill_zeros_like_op.h | 4 +- paddle/fluid/operators/ftrl_op.cc | 2 +- paddle/fluid/operators/ftrl_op.cu | 2 +- paddle/fluid/operators/ftrl_op.h | 4 +- paddle/fluid/operators/gather.cu.h | 4 +- paddle/fluid/operators/gather.h | 8 +- paddle/fluid/operators/gather_op.cc | 4 +- paddle/fluid/operators/gather_op.cu | 4 +- paddle/fluid/operators/gather_op.h | 4 +- paddle/fluid/operators/gather_test.cc | 8 +- paddle/fluid/operators/gaussian_random_op.cc | 2 +- paddle/fluid/operators/gaussian_random_op.cu | 4 +- paddle/fluid/operators/get_places_op.cc | 8 +- paddle/fluid/operators/gru_op.cc | 2 +- paddle/fluid/operators/gru_op.cu.cc | 2 +- paddle/fluid/operators/gru_op.h | 12 +- paddle/fluid/operators/gru_unit_op.cc | 2 +- paddle/fluid/operators/gru_unit_op.cu | 2 +- paddle/fluid/operators/gru_unit_op.h | 8 +- paddle/fluid/operators/hinge_loss_op.cc | 2 +- paddle/fluid/operators/hinge_loss_op.cu | 2 +- paddle/fluid/operators/hinge_loss_op.h | 4 +- paddle/fluid/operators/huber_loss_op.cc | 2 +- paddle/fluid/operators/huber_loss_op.cu | 2 +- paddle/fluid/operators/huber_loss_op.h | 6 +- paddle/fluid/operators/im2sequence_op.cc | 2 +- paddle/fluid/operators/im2sequence_op.cu | 2 +- paddle/fluid/operators/im2sequence_op.h | 10 +- paddle/fluid/operators/increment_op.cc | 2 +- paddle/fluid/operators/iou_similarity_op.cc | 2 +- paddle/fluid/operators/iou_similarity_op.cu | 2 +- paddle/fluid/operators/iou_similarity_op.h | 4 +- paddle/fluid/operators/is_empty_op.cc | 4 +- paddle/fluid/operators/l1_norm_op.cc | 2 +- paddle/fluid/operators/l1_norm_op.cu | 2 +- paddle/fluid/operators/l1_norm_op.h | 4 +- paddle/fluid/operators/label_smooth_op.cc | 2 +- paddle/fluid/operators/label_smooth_op.cu | 2 +- paddle/fluid/operators/label_smooth_op.h | 4 +- paddle/fluid/operators/layer_norm_op.cc | 2 +- paddle/fluid/operators/layer_norm_op.cu | 2 +- paddle/fluid/operators/layer_norm_op.h | 8 +- paddle/fluid/operators/linear_chain_crf_op.cc | 2 +- paddle/fluid/operators/linear_chain_crf_op.cu | 2 +- paddle/fluid/operators/linear_chain_crf_op.h | 6 +- paddle/fluid/operators/listen_and_serv_op.cc | 16 +-- paddle/fluid/operators/load_combine_op.cc | 4 +- paddle/fluid/operators/load_op.cc | 4 +- paddle/fluid/operators/lod_array_length_op.cc | 4 +- paddle/fluid/operators/lod_rank_table_op.cc | 4 +- paddle/fluid/operators/lod_reset_op.cc | 2 +- paddle/fluid/operators/lod_reset_op.cu | 2 +- paddle/fluid/operators/lod_reset_op.h | 4 +- .../fluid/operators/lod_tensor_to_array_op.cc | 10 +- paddle/fluid/operators/log_loss_op.cc | 2 +- paddle/fluid/operators/log_loss_op.cu | 2 +- paddle/fluid/operators/log_loss_op.h | 4 +- paddle/fluid/operators/logical_op.cc | 4 +- paddle/fluid/operators/logical_op.cu | 2 +- paddle/fluid/operators/logical_op.h | 4 +- paddle/fluid/operators/lookup_table_op.cc | 4 +- paddle/fluid/operators/lookup_table_op.cu | 10 +- paddle/fluid/operators/lookup_table_op.h | 8 +- paddle/fluid/operators/lrn_op.cc | 2 +- paddle/fluid/operators/lrn_op.cu | 2 +- paddle/fluid/operators/lrn_op.h | 6 +- paddle/fluid/operators/lstm_op.cc | 2 +- paddle/fluid/operators/lstm_op.cu.cc | 2 +- paddle/fluid/operators/lstm_op.h | 10 +- paddle/fluid/operators/lstm_unit_op.cc | 2 +- paddle/fluid/operators/lstm_unit_op.cu | 8 +- paddle/fluid/operators/lstm_unit_op.h | 2 +- paddle/fluid/operators/lstmp_op.cc | 2 +- paddle/fluid/operators/lstmp_op.cu | 2 +- paddle/fluid/operators/lstmp_op.h | 16 +-- paddle/fluid/operators/margin_rank_loss_op.cc | 2 +- paddle/fluid/operators/margin_rank_loss_op.cu | 2 +- paddle/fluid/operators/margin_rank_loss_op.h | 4 +- .../fluid/operators/math/context_project.cc | 2 +- .../fluid/operators/math/context_project.cu | 2 +- paddle/fluid/operators/math/context_project.h | 6 +- .../fluid/operators/math/cos_sim_functor.cc | 2 +- .../fluid/operators/math/cos_sim_functor.cu | 4 +- paddle/fluid/operators/math/cos_sim_functor.h | 4 +- paddle/fluid/operators/math/cross_entropy.cc | 2 +- paddle/fluid/operators/math/cross_entropy.cu | 2 +- paddle/fluid/operators/math/cross_entropy.h | 6 +- paddle/fluid/operators/math/depthwise_conv.cu | 4 +- paddle/fluid/operators/math/depthwise_conv.h | 6 +- .../math/detail/activation_functions.h | 4 +- .../operators/math/detail/avx_functions.cc | 2 +- .../operators/math/detail/gru_cpu_kernel.h | 4 +- .../operators/math/detail/gru_gpu_kernel.h | 8 +- .../fluid/operators/math/detail/gru_kernel.h | 4 +- .../operators/math/detail/lstm_cpu_kernel.h | 4 +- .../operators/math/detail/lstm_gpu_kernel.h | 8 +- .../fluid/operators/math/detail/lstm_kernel.h | 4 +- paddle/fluid/operators/math/detection_util.h | 4 +- paddle/fluid/operators/math/gru_compute.cc | 8 +- paddle/fluid/operators/math/gru_compute.cu | 8 +- paddle/fluid/operators/math/gru_compute.h | 6 +- paddle/fluid/operators/math/im2col.cc | 2 +- paddle/fluid/operators/math/im2col.cu | 4 +- paddle/fluid/operators/math/im2col.h | 6 +- paddle/fluid/operators/math/im2col_test.cc | 2 +- paddle/fluid/operators/math/lstm_compute.cc | 6 +- paddle/fluid/operators/math/lstm_compute.cu | 6 +- paddle/fluid/operators/math/lstm_compute.h | 6 +- paddle/fluid/operators/math/math_function.cc | 6 +- paddle/fluid/operators/math/math_function.cu | 6 +- paddle/fluid/operators/math/math_function.h | 10 +- .../fluid/operators/math/math_function_impl.h | 4 +- .../operators/math/math_function_test.cc | 2 +- .../operators/math/math_function_test.cu | 2 +- paddle/fluid/operators/math/matmul.h | 2 +- paddle/fluid/operators/math/maxouting.cc | 2 +- paddle/fluid/operators/math/maxouting.cu | 4 +- paddle/fluid/operators/math/maxouting.h | 6 +- paddle/fluid/operators/math/pooling.cc | 2 +- paddle/fluid/operators/math/pooling.cu | 4 +- paddle/fluid/operators/math/pooling.h | 8 +- .../operators/math/selected_rows_functor.cc | 4 +- .../operators/math/selected_rows_functor.cu | 6 +- .../operators/math/selected_rows_functor.h | 6 +- .../math/selected_rows_functor_test.cc | 4 +- .../math/selected_rows_functor_test.cu | 4 +- paddle/fluid/operators/math/sequence2batch.cc | 4 +- paddle/fluid/operators/math/sequence2batch.cu | 2 +- paddle/fluid/operators/math/sequence2batch.h | 8 +- .../fluid/operators/math/sequence_padding.cc | 2 +- .../fluid/operators/math/sequence_padding.cu | 2 +- .../fluid/operators/math/sequence_padding.h | 4 +- .../operators/math/sequence_padding_test.cc | 2 +- .../fluid/operators/math/sequence_pooling.cc | 4 +- .../fluid/operators/math/sequence_pooling.cu | 4 +- .../fluid/operators/math/sequence_pooling.h | 6 +- paddle/fluid/operators/math/sequence_scale.cc | 2 +- paddle/fluid/operators/math/sequence_scale.cu | 4 +- paddle/fluid/operators/math/sequence_scale.h | 4 +- paddle/fluid/operators/math/softmax.cc | 4 +- paddle/fluid/operators/math/softmax.cu | 4 +- paddle/fluid/operators/math/softmax.h | 2 +- paddle/fluid/operators/math/softmax_impl.h | 4 +- paddle/fluid/operators/math/unpooling.cc | 2 +- paddle/fluid/operators/math/unpooling.cu | 4 +- paddle/fluid/operators/math/unpooling.h | 2 +- paddle/fluid/operators/math/vol2col.cc | 2 +- paddle/fluid/operators/math/vol2col.cu | 4 +- paddle/fluid/operators/math/vol2col.h | 6 +- paddle/fluid/operators/math/vol2col_test.cc | 2 +- paddle/fluid/operators/matmul_op.cc | 2 +- paddle/fluid/operators/matmul_op.cu.cc | 2 +- paddle/fluid/operators/matmul_op.h | 6 +- paddle/fluid/operators/max_sequence_len_op.cc | 6 +- paddle/fluid/operators/maxout_op.cc | 2 +- paddle/fluid/operators/maxout_op.cu.cc | 2 +- paddle/fluid/operators/maxout_op.h | 6 +- paddle/fluid/operators/mean_op.cc | 2 +- paddle/fluid/operators/mean_op.cu | 2 +- paddle/fluid/operators/mean_op.h | 4 +- paddle/fluid/operators/merge_lod_tensor_op.cc | 4 +- .../fluid/operators/mine_hard_examples_op.cc | 4 +- paddle/fluid/operators/minus_op.cc | 4 +- paddle/fluid/operators/minus_op.cu | 2 +- paddle/fluid/operators/minus_op.h | 4 +- .../fluid/operators/modified_huber_loss_op.cc | 2 +- .../fluid/operators/modified_huber_loss_op.cu | 6 +- .../fluid/operators/modified_huber_loss_op.h | 6 +- paddle/fluid/operators/momentum_op.cc | 2 +- paddle/fluid/operators/momentum_op.cu | 2 +- paddle/fluid/operators/momentum_op.h | 4 +- paddle/fluid/operators/mul_op.cc | 2 +- paddle/fluid/operators/mul_op.cu.cc | 2 +- paddle/fluid/operators/mul_op.h | 4 +- paddle/fluid/operators/multiclass_nms_op.cc | 2 +- paddle/fluid/operators/multiplex_op.cc | 2 +- paddle/fluid/operators/multiplex_op.cu | 4 +- paddle/fluid/operators/multiplex_op.h | 6 +- .../fluid/operators/nccl/nccl_gpu_common.cc | 4 +- paddle/fluid/operators/nccl/nccl_gpu_common.h | 8 +- paddle/fluid/operators/nccl_op.cc | 4 +- paddle/fluid/operators/nccl_op.cu.cc | 6 +- paddle/fluid/operators/nccl_op_test.cu.cc | 22 ++-- paddle/fluid/operators/nce_op.cc | 2 +- paddle/fluid/operators/nce_op.h | 4 +- paddle/fluid/operators/net_op.cc | 4 +- paddle/fluid/operators/net_op.h | 4 +- paddle/fluid/operators/net_op_test.cc | 2 +- paddle/fluid/operators/norm_op.cc | 2 +- paddle/fluid/operators/norm_op.cu | 2 +- paddle/fluid/operators/norm_op.h | 4 +- paddle/fluid/operators/one_hot_op.cc | 4 +- paddle/fluid/operators/one_hot_op.cu | 6 +- paddle/fluid/operators/one_hot_op.h | 4 +- paddle/fluid/operators/pad_op.cc | 2 +- paddle/fluid/operators/pad_op.cu | 2 +- paddle/fluid/operators/pad_op.h | 4 +- paddle/fluid/operators/parallel_do_op.cc | 8 +- paddle/fluid/operators/pool_cudnn_op.cu.cc | 6 +- paddle/fluid/operators/pool_op.cc | 2 +- paddle/fluid/operators/pool_op.cu.cc | 2 +- paddle/fluid/operators/pool_op.h | 8 +- paddle/fluid/operators/pool_with_index_op.cc | 2 +- .../fluid/operators/pool_with_index_op.cu.cc | 2 +- paddle/fluid/operators/pool_with_index_op.h | 8 +- .../operators/positive_negative_pair_op.cc | 2 +- .../operators/positive_negative_pair_op.h | 4 +- paddle/fluid/operators/precision_recall_op.cc | 2 +- paddle/fluid/operators/precision_recall_op.h | 4 +- paddle/fluid/operators/prelu_op.cc | 4 +- paddle/fluid/operators/prelu_op.cu | 2 +- paddle/fluid/operators/prelu_op.h | 6 +- paddle/fluid/operators/print_op.cc | 4 +- paddle/fluid/operators/prior_box_op.cc | 2 +- paddle/fluid/operators/prior_box_op.h | 6 +- paddle/fluid/operators/proximal_adagrad_op.cc | 2 +- paddle/fluid/operators/proximal_adagrad_op.cu | 2 +- paddle/fluid/operators/proximal_adagrad_op.h | 4 +- paddle/fluid/operators/proximal_gd_op.cc | 2 +- paddle/fluid/operators/proximal_gd_op.cu | 2 +- paddle/fluid/operators/proximal_gd_op.h | 4 +- paddle/fluid/operators/rank_loss_op.cc | 2 +- paddle/fluid/operators/rank_loss_op.cu | 2 +- paddle/fluid/operators/rank_loss_op.h | 4 +- paddle/fluid/operators/read_op.cc | 4 +- paddle/fluid/operators/recurrent_op.cc | 4 +- paddle/fluid/operators/recv_op.cc | 10 +- paddle/fluid/operators/reduce_op.cc | 2 +- paddle/fluid/operators/reduce_op.cu | 2 +- paddle/fluid/operators/reduce_op.h | 4 +- .../reorder_lod_tensor_by_rank_op.cc | 8 +- paddle/fluid/operators/reshape_op.cc | 2 +- paddle/fluid/operators/reshape_op.cu | 2 +- paddle/fluid/operators/reshape_op.h | 4 +- paddle/fluid/operators/rmsprop_op.cc | 2 +- paddle/fluid/operators/rmsprop_op.cu | 2 +- paddle/fluid/operators/rmsprop_op.h | 4 +- .../fluid/operators/rnn_memory_helper_op.cc | 4 +- paddle/fluid/operators/roi_pool_op.cc | 2 +- paddle/fluid/operators/roi_pool_op.cu | 4 +- paddle/fluid/operators/roi_pool_op.h | 4 +- paddle/fluid/operators/row_conv_op.cc | 4 +- paddle/fluid/operators/row_conv_op.cu | 6 +- paddle/fluid/operators/row_conv_op.h | 2 +- paddle/fluid/operators/save_combine_op.cc | 10 +- .../operators/save_load_combine_op_test.cc | 2 +- paddle/fluid/operators/save_load_op_test.cc | 2 +- paddle/fluid/operators/save_op.cc | 10 +- paddle/fluid/operators/scale_op.cc | 4 +- paddle/fluid/operators/scale_op.cu | 2 +- paddle/fluid/operators/scale_op.h | 4 +- paddle/fluid/operators/scatter.cu.h | 4 +- paddle/fluid/operators/scatter.h | 8 +- paddle/fluid/operators/scatter_op.cc | 4 +- paddle/fluid/operators/scatter_op.cu | 2 +- paddle/fluid/operators/scatter_op.h | 4 +- paddle/fluid/operators/scatter_test.cc | 8 +- paddle/fluid/operators/send_op.cc | 10 +- paddle/fluid/operators/send_recv_op_test.cc | 10 +- paddle/fluid/operators/sequence_concat_op.cc | 2 +- .../fluid/operators/sequence_concat_op.cu.cc | 2 +- paddle/fluid/operators/sequence_concat_op.h | 4 +- paddle/fluid/operators/sequence_conv_op.cc | 2 +- paddle/fluid/operators/sequence_conv_op.cu.cc | 2 +- paddle/fluid/operators/sequence_conv_op.h | 6 +- paddle/fluid/operators/sequence_erase_op.cc | 2 +- paddle/fluid/operators/sequence_erase_op.cu | 4 +- paddle/fluid/operators/sequence_erase_op.h | 2 +- paddle/fluid/operators/sequence_expand_op.cc | 2 +- paddle/fluid/operators/sequence_expand_op.cu | 2 +- paddle/fluid/operators/sequence_expand_op.h | 4 +- paddle/fluid/operators/sequence_pool_op.cc | 2 +- paddle/fluid/operators/sequence_pool_op.cu | 2 +- paddle/fluid/operators/sequence_pool_op.h | 8 +- paddle/fluid/operators/sequence_reshape_op.cc | 4 +- paddle/fluid/operators/sequence_reshape_op.cu | 2 +- paddle/fluid/operators/sequence_reshape_op.h | 4 +- paddle/fluid/operators/sequence_slice_op.cc | 2 +- paddle/fluid/operators/sequence_slice_op.cu | 2 +- paddle/fluid/operators/sequence_slice_op.h | 6 +- paddle/fluid/operators/sequence_softmax_op.cc | 2 +- .../fluid/operators/sequence_softmax_op.cu.cc | 2 +- paddle/fluid/operators/sequence_softmax_op.h | 4 +- paddle/fluid/operators/sgd_op.cc | 2 +- paddle/fluid/operators/sgd_op.cu | 4 +- paddle/fluid/operators/sgd_op.h | 6 +- .../fluid/operators/shrink_rnn_memory_op.cc | 8 +- .../sigmoid_cross_entropy_with_logits_op.cc | 2 +- .../sigmoid_cross_entropy_with_logits_op.cu | 2 +- .../sigmoid_cross_entropy_with_logits_op.h | 4 +- paddle/fluid/operators/sign_op.cc | 2 +- paddle/fluid/operators/sign_op.cu | 2 +- paddle/fluid/operators/sign_op.h | 4 +- paddle/fluid/operators/smooth_l1_loss_op.cc | 2 +- paddle/fluid/operators/smooth_l1_loss_op.cu | 2 +- paddle/fluid/operators/smooth_l1_loss_op.h | 6 +- paddle/fluid/operators/softmax_op.cc | 2 +- paddle/fluid/operators/softmax_op.cu.cc | 2 +- paddle/fluid/operators/softmax_op.h | 4 +- .../softmax_with_cross_entropy_op.cc | 2 +- .../softmax_with_cross_entropy_op.cu | 2 +- .../operators/softmax_with_cross_entropy_op.h | 8 +- paddle/fluid/operators/split_lod_tensor_op.cc | 6 +- paddle/fluid/operators/split_op.cc | 4 +- paddle/fluid/operators/split_op.cu.cc | 2 +- paddle/fluid/operators/split_op.h | 4 +- .../fluid/operators/split_selected_rows_op.cc | 2 +- .../fluid/operators/split_selected_rows_op.cu | 2 +- .../fluid/operators/split_selected_rows_op.h | 4 +- paddle/fluid/operators/spp_op.cc | 2 +- paddle/fluid/operators/spp_op.cu.cc | 2 +- paddle/fluid/operators/spp_op.h | 8 +- .../fluid/operators/squared_l2_distance_op.cc | 2 +- .../fluid/operators/squared_l2_distance_op.cu | 2 +- .../fluid/operators/squared_l2_distance_op.h | 4 +- paddle/fluid/operators/squared_l2_norm_op.cc | 2 +- paddle/fluid/operators/squared_l2_norm_op.cu | 2 +- paddle/fluid/operators/squared_l2_norm_op.h | 4 +- paddle/fluid/operators/strided_memcpy.h | 2 +- paddle/fluid/operators/strided_memcpy_test.cc | 4 +- paddle/fluid/operators/sum_op.cc | 6 +- paddle/fluid/operators/sum_op.cu | 2 +- paddle/fluid/operators/sum_op.h | 10 +- paddle/fluid/operators/target_assign_op.cc | 2 +- paddle/fluid/operators/target_assign_op.cu | 2 +- paddle/fluid/operators/target_assign_op.h | 6 +- .../operators/tensor_array_read_write_op.cc | 4 +- paddle/fluid/operators/top_k_op.cc | 2 +- paddle/fluid/operators/top_k_op.cu | 4 +- paddle/fluid/operators/top_k_op.h | 4 +- paddle/fluid/operators/transpose_op.cc | 2 +- paddle/fluid/operators/transpose_op.cu.cc | 2 +- paddle/fluid/operators/transpose_op.h | 4 +- paddle/fluid/operators/uniform_random_op.cc | 4 +- paddle/fluid/operators/uniform_random_op.cu | 4 +- paddle/fluid/operators/unpool_op.cc | 2 +- paddle/fluid/operators/unpool_op.cu.cc | 2 +- paddle/fluid/operators/unpool_op.h | 6 +- paddle/fluid/operators/warpctc_op.cc | 2 +- paddle/fluid/operators/warpctc_op.cu.cc | 2 +- paddle/fluid/operators/warpctc_op.h | 10 +- paddle/fluid/operators/while_op.cc | 10 +- paddle/fluid/platform/cpu_info.cc | 2 +- paddle/fluid/platform/cpu_info_test.cc | 2 +- paddle/fluid/platform/cudnn_helper.h | 6 +- paddle/fluid/platform/cudnn_helper_test.cc | 2 +- paddle/fluid/platform/device_context.cc | 4 +- paddle/fluid/platform/device_context.h | 12 +- paddle/fluid/platform/device_context_test.cu | 2 +- paddle/fluid/platform/dynload/cublas.cc | 2 +- paddle/fluid/platform/dynload/cublas.h | 2 +- paddle/fluid/platform/dynload/cudnn.cc | 4 +- paddle/fluid/platform/dynload/cudnn.h | 2 +- paddle/fluid/platform/dynload/curand.cc | 2 +- paddle/fluid/platform/dynload/curand.h | 2 +- .../fluid/platform/dynload/dynamic_loader.cc | 4 +- paddle/fluid/platform/dynload/nccl.cc | 2 +- paddle/fluid/platform/dynload/nccl.h | 4 +- paddle/fluid/platform/dynload/warpctc.cc | 2 +- paddle/fluid/platform/dynload/warpctc.h | 2 +- paddle/fluid/platform/enforce.cc | 2 +- paddle/fluid/platform/enforce.h | 10 +- paddle/fluid/platform/enforce_test.cc | 2 +- paddle/fluid/platform/for_range.h | 2 +- paddle/fluid/platform/gpu_info.cc | 4 +- paddle/fluid/platform/nccl_test.cu | 10 +- paddle/fluid/platform/place.cc | 2 +- paddle/fluid/platform/place.h | 4 +- paddle/fluid/platform/place_test.cc | 2 +- paddle/fluid/platform/profiler.cc | 2 +- paddle/fluid/platform/profiler.h | 2 +- paddle/fluid/platform/profiler_test.cc | 2 +- paddle/fluid/platform/transform.h | 10 +- paddle/fluid/platform/transform_test.cu | 8 +- paddle/fluid/pybind/.clang-format | 6 +- paddle/fluid/pybind/const_value.cc | 2 +- paddle/fluid/pybind/const_value.h | 2 +- paddle/fluid/pybind/exception.cc | 2 +- paddle/fluid/pybind/exception.h | 2 +- paddle/fluid/pybind/protobuf.cc | 12 +- paddle/fluid/pybind/protobuf.h | 2 +- paddle/fluid/pybind/pybind.cc | 46 +++---- paddle/fluid/pybind/tensor_py.h | 6 +- paddle/math/float16.h | 2 +- paddle/testing/paddle_gtest_main.cc | 4 +- 649 files changed, 1534 insertions(+), 1404 deletions(-) mode change 120000 => 100644 paddle/fluid/framework/tensor_util.cu mode change 120000 => 100644 paddle/fluid/memory/.clang-format mode change 120000 => 100644 paddle/fluid/operators/.clang-format mode change 120000 => 100644 paddle/fluid/pybind/.clang-format diff --git a/paddle/fluid/framework/attribute.cc b/paddle/fluid/framework/attribute.cc index 5074e8f5a05..1d7e7366b07 100644 --- a/paddle/fluid/framework/attribute.cc +++ b/paddle/fluid/framework/attribute.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/attribute.h" +#include "paddle/fluid/framework/attribute.h" #include diff --git a/paddle/fluid/framework/attribute.h b/paddle/fluid/framework/attribute.h index bcff9bc4c48..16be42ae714 100644 --- a/paddle/fluid/framework/attribute.h +++ b/paddle/fluid/framework/attribute.h @@ -20,9 +20,9 @@ limitations under the License. */ #include #include -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/type_defs.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/type_defs.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/backward.cc b/paddle/fluid/framework/backward.cc index f52a51519fc..c4795f4fc5c 100644 --- a/paddle/fluid/framework/backward.cc +++ b/paddle/fluid/framework/backward.cc @@ -12,17 +12,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/backward.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/framework/backward.h" +#include "paddle/fluid/operators/net_op.h" #include #include #include #include -#include "paddle/framework/block_desc.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/net_op.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/backward.h b/paddle/fluid/framework/backward.h index 69ee3802369..2ea6922426e 100644 --- a/paddle/fluid/framework/backward.h +++ b/paddle/fluid/framework/backward.h @@ -18,8 +18,8 @@ limitations under the License. */ #include #include -#include "paddle/framework/operator.h" -#include "paddle/framework/program_desc.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/program_desc.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/backward_test.cc b/paddle/fluid/framework/backward_test.cc index 72743b5fd0b..f9604c68913 100644 --- a/paddle/fluid/framework/backward_test.cc +++ b/paddle/fluid/framework/backward_test.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/backward.h" +#include "paddle/fluid/framework/backward.h" #include -#include "paddle/framework/block_desc.h" -#include "paddle/framework/op_desc.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/var_desc.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/op_desc.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/var_desc.h" +#include "paddle/fluid/operators/net_op.h" USE_NO_KERNEL_OP(fill_constant); diff --git a/paddle/fluid/framework/block_desc.cc b/paddle/fluid/framework/block_desc.cc index 3e344ea3790..9550159155c 100644 --- a/paddle/fluid/framework/block_desc.cc +++ b/paddle/fluid/framework/block_desc.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/block_desc.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/program_desc.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/program_desc.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/block_desc.h b/paddle/fluid/framework/block_desc.h index 4b609e4bcb6..5f7eca3878f 100644 --- a/paddle/fluid/framework/block_desc.h +++ b/paddle/fluid/framework/block_desc.h @@ -20,10 +20,10 @@ limitations under the License. */ #include #include -#include "paddle/framework/op_desc.h" -#include "paddle/framework/proto_desc.h" -#include "paddle/framework/var_desc.h" -#include "paddle/platform/macros.h" +#include "paddle/fluid/framework/op_desc.h" +#include "paddle/fluid/framework/proto_desc.h" +#include "paddle/fluid/framework/var_desc.h" +#include "paddle/fluid/platform/macros.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/channel.h b/paddle/fluid/framework/channel.h index 146f0e9e71e..5acf4fb39bb 100644 --- a/paddle/fluid/framework/channel.h +++ b/paddle/fluid/framework/channel.h @@ -54,5 +54,5 @@ void CloseChannel(Channel* ch) { } // namespace framework } // namespace paddle -#include "paddle/framework/details/buffered_channel.h" -#include "paddle/framework/details/unbuffered_channel.h" +#include "paddle/fluid/framework/details/buffered_channel.h" +#include "paddle/fluid/framework/details/unbuffered_channel.h" diff --git a/paddle/fluid/framework/channel_test.cc b/paddle/fluid/framework/channel_test.cc index d7140dd1066..953fa40fec8 100644 --- a/paddle/fluid/framework/channel_test.cc +++ b/paddle/fluid/framework/channel_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/channel.h" +#include "paddle/fluid/framework/channel.h" #include #include diff --git a/paddle/fluid/framework/data_device_transform.cc b/paddle/fluid/framework/data_device_transform.cc index 5daf5a4e0ab..3c6dd28455b 100644 --- a/paddle/fluid/framework/data_device_transform.cc +++ b/paddle/fluid/framework/data_device_transform.cc @@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/data_device_transform.h" +#include "paddle/fluid/framework/data_device_transform.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_device_transform.h b/paddle/fluid/framework/data_device_transform.h index 39750a85f27..0c4559f586a 100644 --- a/paddle/fluid/framework/data_device_transform.h +++ b/paddle/fluid/framework/data_device_transform.h @@ -13,10 +13,10 @@ limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/tensor.h" -#include "paddle/framework/tensor_util.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/tensor_util.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_device_transform_test.cu b/paddle/fluid/framework/data_device_transform_test.cu index efc05b3106b..f740f9b3268 100644 --- a/paddle/fluid/framework/data_device_transform_test.cu +++ b/paddle/fluid/framework/data_device_transform_test.cu @@ -14,13 +14,13 @@ limitations under the License. */ #include "gtest/gtest.h" -#include "paddle/framework/init.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_info.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/elementwise_op_function.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_info.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_layout.h b/paddle/fluid/framework/data_layout.h index 31817251ed0..b72f13f2e8f 100644 --- a/paddle/fluid/framework/data_layout.h +++ b/paddle/fluid/framework/data_layout.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_layout_transform.cc b/paddle/fluid/framework/data_layout_transform.cc index 9d0a6d5ea3e..c546a508fe1 100644 --- a/paddle/fluid/framework/data_layout_transform.cc +++ b/paddle/fluid/framework/data_layout_transform.cc @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/data_layout_transform.h" +#include "paddle/fluid/framework/data_layout_transform.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_layout_transform.h b/paddle/fluid/framework/data_layout_transform.h index 368f7fc9898..862405fbf46 100644 --- a/paddle/fluid/framework/data_layout_transform.h +++ b/paddle/fluid/framework/data_layout_transform.h @@ -14,9 +14,9 @@ #pragma once -#include "paddle/framework/op_kernel_type.h" -#include "paddle/framework/tensor.h" -#include "paddle/framework/variable.h" +#include "paddle/fluid/framework/op_kernel_type.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/variable.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_layout_transform_test.cc b/paddle/fluid/framework/data_layout_transform_test.cc index 093e8d4d345..99eb46bde34 100644 --- a/paddle/fluid/framework/data_layout_transform_test.cc +++ b/paddle/fluid/framework/data_layout_transform_test.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/data_layout_transform.h" +#include "paddle/fluid/framework/data_layout_transform.h" #include "gtest/gtest.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/platform/device_context.h" TEST(DataTransform, DataLayoutFunction) { using namespace paddle::framework; diff --git a/paddle/fluid/framework/data_transform.cc b/paddle/fluid/framework/data_transform.cc index b6fd46401ff..9575d01af88 100644 --- a/paddle/fluid/framework/data_transform.cc +++ b/paddle/fluid/framework/data_transform.cc @@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/data_transform.h" +#include "paddle/fluid/framework/data_transform.h" -#include "paddle/framework/data_device_transform.h" -#include "paddle/framework/data_layout_transform.h" -#include "paddle/framework/data_type_transform.h" +#include "paddle/fluid/framework/data_device_transform.h" +#include "paddle/fluid/framework/data_layout_transform.h" +#include "paddle/fluid/framework/data_type_transform.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_transform.h b/paddle/fluid/framework/data_transform.h index a4b78902379..70d3a174acc 100644 --- a/paddle/fluid/framework/data_transform.h +++ b/paddle/fluid/framework/data_transform.h @@ -18,14 +18,14 @@ limitations under the License. */ #include #include -#include "paddle/framework/op_kernel_type.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/framework/tensor.h" -#include "paddle/framework/variable.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/macros.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/op_kernel_type.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/variable.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/macros.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_type.h b/paddle/fluid/framework/data_type.h index 98eb3e857d1..7a527f0d0c1 100644 --- a/paddle/fluid/framework/data_type.h +++ b/paddle/fluid/framework/data_type.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/framework.pb.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_type_transform.cc b/paddle/fluid/framework/data_type_transform.cc index 7df1cc6b75b..6921927305a 100644 --- a/paddle/fluid/framework/data_type_transform.cc +++ b/paddle/fluid/framework/data_type_transform.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/data_type_transform.h" +#include "paddle/fluid/framework/data_type_transform.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_type_transform.h b/paddle/fluid/framework/data_type_transform.h index 067c0c2a5b1..830cced0939 100644 --- a/paddle/fluid/framework/data_type_transform.h +++ b/paddle/fluid/framework/data_type_transform.h @@ -14,10 +14,10 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_kernel_type.h" -#include "paddle/framework/tensor.h" -#include "paddle/framework/variable.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/op_kernel_type.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/variable.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/data_type_transform_test.cc b/paddle/fluid/framework/data_type_transform_test.cc index 89d32f52833..88dbc51b217 100644 --- a/paddle/fluid/framework/data_type_transform_test.cc +++ b/paddle/fluid/framework/data_type_transform_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/data_type_transform.h" +#include "paddle/fluid/framework/data_type_transform.h" #include "gtest/gtest.h" diff --git a/paddle/fluid/framework/ddim.cc b/paddle/fluid/framework/ddim.cc index 8b6f42b82df..f063ee2e6dd 100644 --- a/paddle/fluid/framework/ddim.cc +++ b/paddle/fluid/framework/ddim.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/ddim.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/ddim.h b/paddle/fluid/framework/ddim.h index 4ca5e49566b..750ab787abb 100644 --- a/paddle/fluid/framework/ddim.h +++ b/paddle/fluid/framework/ddim.h @@ -17,9 +17,9 @@ limitations under the License. */ #include #include #include -#include "paddle/framework/dim.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/variant.h" +#include "paddle/fluid/framework/dim.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/variant.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/ddim_test.cc b/paddle/fluid/framework/ddim_test.cc index bc259d1f603..18d305a4036 100644 --- a/paddle/fluid/framework/ddim_test.cc +++ b/paddle/fluid/framework/ddim_test.cc @@ -15,7 +15,7 @@ limitations under the License. */ #include #include "gtest/gtest.h" -#include "paddle/framework/ddim.h" +#include "paddle/fluid/framework/ddim.h" TEST(DDim, Equality) { // construct a DDim from an initialization list diff --git a/paddle/fluid/framework/details/buffered_channel.h b/paddle/fluid/framework/details/buffered_channel.h index 227a4e4811f..88faf3acf7c 100644 --- a/paddle/fluid/framework/details/buffered_channel.h +++ b/paddle/fluid/framework/details/buffered_channel.h @@ -18,8 +18,8 @@ limitations under the License. */ #include #include -#include "paddle/framework/channel.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/channel.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/details/cow_ptr_test.cc b/paddle/fluid/framework/details/cow_ptr_test.cc index 1f4a12bca0d..d2142af277c 100644 --- a/paddle/fluid/framework/details/cow_ptr_test.cc +++ b/paddle/fluid/framework/details/cow_ptr_test.cc @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/details/cow_ptr.h" +#include "paddle/fluid/framework/details/cow_ptr.h" #include "gtest/gtest.h" namespace paddle { diff --git a/paddle/fluid/framework/details/op_registry.h b/paddle/fluid/framework/details/op_registry.h index 31a40bcbcb3..d73604ad185 100644 --- a/paddle/fluid/framework/details/op_registry.h +++ b/paddle/fluid/framework/details/op_registry.h @@ -14,11 +14,11 @@ limitations under the License. */ #pragma once -#include "paddle/framework/grad_op_desc_maker.h" -#include "paddle/framework/op_info.h" -#include "paddle/framework/op_proto_maker.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/var_type_inference.h" +#include "paddle/fluid/framework/grad_op_desc_maker.h" +#include "paddle/fluid/framework/op_info.h" +#include "paddle/fluid/framework/op_proto_maker.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/var_type_inference.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/details/unbuffered_channel.h b/paddle/fluid/framework/details/unbuffered_channel.h index 6b5c2196cb2..5c9424928cb 100644 --- a/paddle/fluid/framework/details/unbuffered_channel.h +++ b/paddle/fluid/framework/details/unbuffered_channel.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include -#include "paddle/framework/channel.h" +#include "paddle/fluid/framework/channel.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/dim.h b/paddle/fluid/framework/dim.h index ec17d7c6156..3938fd3df5b 100644 --- a/paddle/fluid/framework/dim.h +++ b/paddle/fluid/framework/dim.h @@ -18,8 +18,8 @@ #include #include -#include "paddle/platform/assert.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/dim_test.cu b/paddle/fluid/framework/dim_test.cu index 2bcab7c5c2e..0f1969d7977 100644 --- a/paddle/fluid/framework/dim_test.cu +++ b/paddle/fluid/framework/dim_test.cu @@ -15,7 +15,7 @@ #include #include "gtest/gtest.h" -#include "paddle/framework/dim.h" +#include "paddle/fluid/framework/dim.h" __global__ void test(paddle::framework::Dim<2>* o) { o[0] = paddle::framework::make_dim(5, 6); diff --git a/paddle/fluid/framework/eigen.h b/paddle/fluid/framework/eigen.h index 54bbeafcabd..d1b8c701a79 100644 --- a/paddle/fluid/framework/eigen.h +++ b/paddle/fluid/framework/eigen.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" +#include "paddle/fluid/framework/tensor.h" #include "unsupported/Eigen/CXX11/Tensor" namespace paddle { diff --git a/paddle/fluid/framework/eigen_test.cc b/paddle/fluid/framework/eigen_test.cc index 9e368a522ce..f9e3abeccb3 100644 --- a/paddle/fluid/framework/eigen_test.cc +++ b/paddle/fluid/framework/eigen_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/eigen.h" +#include "paddle/fluid/framework/eigen.h" #include namespace paddle { diff --git a/paddle/fluid/framework/executor.cc b/paddle/fluid/framework/executor.cc index 2a88e5a9298..816ad8d6590 100644 --- a/paddle/fluid/framework/executor.cc +++ b/paddle/fluid/framework/executor.cc @@ -12,19 +12,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/executor.h" +#include "paddle/fluid/framework/executor.h" #include #include "gflags/gflags.h" -#include "paddle/framework/feed_fetch_method.h" -#include "paddle/framework/feed_fetch_type.h" -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/reader.h" -#include "paddle/platform/place.h" -#include "paddle/platform/profiler.h" +#include "paddle/fluid/framework/feed_fetch_method.h" +#include "paddle/fluid/framework/feed_fetch_type.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/reader.h" +#include "paddle/fluid/platform/place.h" +#include "paddle/fluid/platform/profiler.h" DECLARE_bool(benchmark); DEFINE_bool(check_nan_inf, false, diff --git a/paddle/fluid/framework/executor.h b/paddle/fluid/framework/executor.h index 035ff48a52b..893c949939e 100644 --- a/paddle/fluid/framework/executor.h +++ b/paddle/fluid/framework/executor.h @@ -14,11 +14,11 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_info.h" -#include "paddle/framework/program_desc.h" -#include "paddle/framework/scope.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/op_info.h" +#include "paddle/fluid/framework/program_desc.h" +#include "paddle/fluid/framework/scope.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/feed_fetch_method.cc b/paddle/fluid/framework/feed_fetch_method.cc index 21201b67551..a9bb17355d9 100644 --- a/paddle/fluid/framework/feed_fetch_method.cc +++ b/paddle/fluid/framework/feed_fetch_method.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/feed_fetch_method.h" +#include "paddle/fluid/framework/feed_fetch_method.h" #include "glog/logging.h" -#include "paddle/framework/variable.h" +#include "paddle/fluid/framework/variable.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/feed_fetch_method.h b/paddle/fluid/framework/feed_fetch_method.h index b71945fcc88..5355c29047e 100644 --- a/paddle/fluid/framework/feed_fetch_method.h +++ b/paddle/fluid/framework/feed_fetch_method.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/feed_fetch_type.h" -#include "paddle/framework/scope.h" +#include "paddle/fluid/framework/feed_fetch_type.h" +#include "paddle/fluid/framework/scope.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/feed_fetch_type.h b/paddle/fluid/framework/feed_fetch_type.h index 168f456675a..4281e36b138 100644 --- a/paddle/fluid/framework/feed_fetch_type.h +++ b/paddle/fluid/framework/feed_fetch_type.h @@ -15,7 +15,7 @@ limitations under the License. */ #pragma once #include #include -#include "paddle/framework/lod_tensor.h" +#include "paddle/fluid/framework/lod_tensor.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/grad_op_desc_maker.h b/paddle/fluid/framework/grad_op_desc_maker.h index f51753453be..21dd4e88548 100644 --- a/paddle/fluid/framework/grad_op_desc_maker.h +++ b/paddle/fluid/framework/grad_op_desc_maker.h @@ -16,8 +16,8 @@ limitations under the License. */ #include #include #include -#include "paddle/framework/op_desc.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/op_desc.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/init.cc b/paddle/fluid/framework/init.cc index 3f6ea121b39..cb2d740d860 100644 --- a/paddle/fluid/framework/init.cc +++ b/paddle/fluid/framework/init.cc @@ -16,10 +16,10 @@ limitations under the License. */ #include #include -#include "paddle/framework/init.h" -#include "paddle/framework/operator.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/place.h" #include "paddle/string/piece.h" namespace paddle { diff --git a/paddle/fluid/framework/init_test.cc b/paddle/fluid/framework/init_test.cc index 01e076dd8ea..f3018541e27 100644 --- a/paddle/fluid/framework/init_test.cc +++ b/paddle/fluid/framework/init_test.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "gtest/gtest.h" -#include "paddle/framework/init.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/platform/device_context.h" TEST(InitDevices, CPU) { using paddle::framework::InitDevices; diff --git a/paddle/fluid/framework/lod_rank_table.cc b/paddle/fluid/framework/lod_rank_table.cc index 704bce2a0eb..31c87492349 100644 --- a/paddle/fluid/framework/lod_rank_table.cc +++ b/paddle/fluid/framework/lod_rank_table.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_rank_table.h" +#include "paddle/fluid/framework/lod_rank_table.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/lod_rank_table.h b/paddle/fluid/framework/lod_rank_table.h index df188709e91..0eaaf49e4c4 100644 --- a/paddle/fluid/framework/lod_rank_table.h +++ b/paddle/fluid/framework/lod_rank_table.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/lod_tensor.h" +#include "paddle/fluid/framework/lod_tensor.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/lod_tensor.cc b/paddle/fluid/framework/lod_tensor.cc index cb27de69916..05c67e453d0 100644 --- a/paddle/fluid/framework/lod_tensor.cc +++ b/paddle/fluid/framework/lod_tensor.cc @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/data_type.h" -#include "paddle/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/framework.pb.h" -#include "paddle/memory/memcpy.h" -#include "paddle/memory/memory.h" +#include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/memory/memory.h" #include #include diff --git a/paddle/fluid/framework/lod_tensor.h b/paddle/fluid/framework/lod_tensor.h index 9de454428d9..1509a9fb134 100644 --- a/paddle/fluid/framework/lod_tensor.h +++ b/paddle/fluid/framework/lod_tensor.h @@ -21,12 +21,12 @@ limitations under the License. */ #endif #include -#include "paddle/framework/ddim.h" -#include "paddle/framework/mixed_vector.h" -#include "paddle/framework/tensor.h" -#include "paddle/framework/tensor_util.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/mixed_vector.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/tensor_util.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/lod_tensor_array.h b/paddle/fluid/framework/lod_tensor_array.h index 4a8e7f4fa54..652513bd225 100644 --- a/paddle/fluid/framework/lod_tensor_array.h +++ b/paddle/fluid/framework/lod_tensor_array.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/lod_tensor.h" +#include "paddle/fluid/framework/lod_tensor.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/lod_tensor_test.cc b/paddle/fluid/framework/lod_tensor_test.cc index 3b63020e685..7e0ed2495d6 100644 --- a/paddle/fluid/framework/lod_tensor_test.cc +++ b/paddle/fluid/framework/lod_tensor_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/lod_tensor.h" +#include "paddle/fluid/framework/lod_tensor.h" #include #include diff --git a/paddle/fluid/framework/lod_tensor_test.cu b/paddle/fluid/framework/lod_tensor_test.cu index a28b7caf86c..4dd7810c1b2 100644 --- a/paddle/fluid/framework/lod_tensor_test.cu +++ b/paddle/fluid/framework/lod_tensor_test.cu @@ -15,12 +15,12 @@ #include #include #include -#include "paddle/framework/init.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/platform/assert.h" -#include -#include +#include "gtest/gtest.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/place.h" __global__ void test(size_t* a, int size) { for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < size; diff --git a/paddle/fluid/framework/mixed_vector.h b/paddle/fluid/framework/mixed_vector.h index f776f0317a2..9756754260d 100644 --- a/paddle/fluid/framework/mixed_vector.h +++ b/paddle/fluid/framework/mixed_vector.h @@ -17,8 +17,8 @@ #include #include -#include "paddle/framework/tensor.h" -#include "paddle/framework/tensor_util.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/tensor_util.h" #include "glog/logging.h" diff --git a/paddle/fluid/framework/mixed_vector_test.cu b/paddle/fluid/framework/mixed_vector_test.cu index f02db8f612c..a8906452566 100644 --- a/paddle/fluid/framework/mixed_vector_test.cu +++ b/paddle/fluid/framework/mixed_vector_test.cu @@ -15,8 +15,8 @@ #include "glog/logging.h" #include "gtest/gtest.h" -#include "paddle/framework/mixed_vector.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/framework/mixed_vector.h" +#include "paddle/fluid/platform/gpu_info.h" template using vec = paddle::framework::Vector; diff --git a/paddle/fluid/framework/op_desc.cc b/paddle/fluid/framework/op_desc.cc index b51afe499bb..b7847326005 100644 --- a/paddle/fluid/framework/op_desc.cc +++ b/paddle/fluid/framework/op_desc.cc @@ -12,15 +12,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_desc.h" +#include "paddle/fluid/framework/op_desc.h" #include #include #include #include "glog/logging.h" -#include "paddle/framework/block_desc.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/program_desc.h" -#include "paddle/framework/shape_inference.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/program_desc.h" +#include "paddle/fluid/framework/shape_inference.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_desc.h b/paddle/fluid/framework/op_desc.h index 13695cff59f..698df829e56 100644 --- a/paddle/fluid/framework/op_desc.h +++ b/paddle/fluid/framework/op_desc.h @@ -16,9 +16,9 @@ limitations under the License. */ #include #include -#include "paddle/framework/attribute.h" -#include "paddle/framework/type_defs.h" -#include "paddle/framework/var_desc.h" +#include "paddle/fluid/framework/attribute.h" +#include "paddle/fluid/framework/type_defs.h" +#include "paddle/fluid/framework/var_desc.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_info.cc b/paddle/fluid/framework/op_info.cc index b520108109b..703c9c3234b 100644 --- a/paddle/fluid/framework/op_info.cc +++ b/paddle/fluid/framework/op_info.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_info.h" +#include "paddle/fluid/framework/op_info.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_info.h b/paddle/fluid/framework/op_info.h index d9b89f9cac9..e6b3ff9e653 100644 --- a/paddle/fluid/framework/op_info.h +++ b/paddle/fluid/framework/op_info.h @@ -18,9 +18,9 @@ limitations under the License. */ #include #include -#include "paddle/framework/attribute.h" -#include "paddle/framework/type_defs.h" -#include "paddle/platform/macros.h" +#include "paddle/fluid/framework/attribute.h" +#include "paddle/fluid/framework/type_defs.h" +#include "paddle/fluid/platform/macros.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_kernel_type.h b/paddle/fluid/framework/op_kernel_type.h index 44adb94d2a8..b5dbff26d7e 100644 --- a/paddle/fluid/framework/op_kernel_type.h +++ b/paddle/fluid/framework/op_kernel_type.h @@ -14,11 +14,11 @@ limitations under the License. */ #pragma once -#include "paddle/framework/data_layout.h" -#include "paddle/framework/data_type.h" -#include "paddle/framework/library_type.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/data_layout.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/library_type.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_kernel_type_test.cc b/paddle/fluid/framework/op_kernel_type_test.cc index cb23bbde014..64096907df5 100644 --- a/paddle/fluid/framework/op_kernel_type_test.cc +++ b/paddle/fluid/framework/op_kernel_type_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_kernel_type.h" +#include "paddle/fluid/framework/op_kernel_type.h" #include #include diff --git a/paddle/fluid/framework/op_proto_maker.cc b/paddle/fluid/framework/op_proto_maker.cc index 151d61d5b17..0a779b10b49 100644 --- a/paddle/fluid/framework/op_proto_maker.cc +++ b/paddle/fluid/framework/op_proto_maker.cc @@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_proto_maker.h" +#include "paddle/fluid/framework/op_proto_maker.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_proto_maker.h b/paddle/fluid/framework/op_proto_maker.h index efd3a5ca535..1dbfc7d37be 100644 --- a/paddle/fluid/framework/op_proto_maker.h +++ b/paddle/fluid/framework/op_proto_maker.h @@ -13,8 +13,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/attribute.h" -#include "paddle/framework/framework.pb.h" +#include "paddle/fluid/framework/attribute.h" +#include "paddle/fluid/framework/framework.pb.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_proto_maker_test.cc b/paddle/fluid/framework/op_proto_maker_test.cc index f16cb6fa3aa..cfefee8dbde 100644 --- a/paddle/fluid/framework/op_proto_maker_test.cc +++ b/paddle/fluid/framework/op_proto_maker_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_proto_maker.h" +#include "paddle/fluid/framework/op_proto_maker.h" #include "gtest/gtest.h" diff --git a/paddle/fluid/framework/op_registry.cc b/paddle/fluid/framework/op_registry.cc index dfa151316da..739ec72ebc1 100644 --- a/paddle/fluid/framework/op_registry.cc +++ b/paddle/fluid/framework/op_registry.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include +#include "paddle/fluid/framework/op_registry.h" #include diff --git a/paddle/fluid/framework/op_registry.h b/paddle/fluid/framework/op_registry.h index 6fb8532b2a8..73faa99668a 100644 --- a/paddle/fluid/framework/op_registry.h +++ b/paddle/fluid/framework/op_registry.h @@ -22,14 +22,14 @@ limitations under the License. */ #include #include "glog/logging.h" // For VLOG() -#include "paddle/framework/attribute.h" -#include "paddle/framework/details/op_registry.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/grad_op_desc_maker.h" -#include "paddle/framework/op_desc.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/scope.h" -#include "paddle/framework/shape_inference.h" +#include "paddle/fluid/framework/attribute.h" +#include "paddle/fluid/framework/details/op_registry.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/grad_op_desc_maker.h" +#include "paddle/fluid/framework/op_desc.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/scope.h" +#include "paddle/fluid/framework/shape_inference.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/op_registry_test.cc b/paddle/fluid/framework/op_registry_test.cc index 341da8befd4..bfbb2cfc2c5 100644 --- a/paddle/fluid/framework/op_registry_test.cc +++ b/paddle/fluid/framework/op_registry_test.cc @@ -15,7 +15,7 @@ #include #include -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace pd = paddle::framework; diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index 52387aabd9d..07c65ae926f 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -16,11 +16,11 @@ limitations under the License. */ #include -#include "paddle/framework/data_transform.h" -#include "paddle/framework/executor.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/shape_inference.h" -#include "paddle/framework/var_type.h" +#include "paddle/fluid/framework/data_transform.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/shape_inference.h" +#include "paddle/fluid/framework/var_type.h" DECLARE_bool(benchmark); diff --git a/paddle/fluid/framework/operator.h b/paddle/fluid/framework/operator.h index c9140f304c8..52300abeb7d 100644 --- a/paddle/fluid/framework/operator.h +++ b/paddle/fluid/framework/operator.h @@ -22,17 +22,17 @@ limitations under the License. */ #include #include "glog/logging.h" // For VLOG -#include "paddle/framework/attribute.h" -#include "paddle/framework/block_desc.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_info.h" -#include "paddle/framework/op_kernel_type.h" -#include "paddle/framework/scope.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/variant.h" +#include "paddle/fluid/framework/attribute.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_info.h" +#include "paddle/fluid/framework/op_kernel_type.h" +#include "paddle/fluid/framework/scope.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/variant.h" #include "paddle/utils/Error.h" namespace paddle { diff --git a/paddle/fluid/framework/operator_test.cc b/paddle/fluid/framework/operator_test.cc index b69d7c7a740..b90f5538bb6 100644 --- a/paddle/fluid/framework/operator_test.cc +++ b/paddle/fluid/framework/operator_test.cc @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "gtest/gtest.h" -#include "paddle/framework/init.h" -#include "paddle/framework/op_info.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/framework/op_info.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/program_desc.cc b/paddle/fluid/framework/program_desc.cc index 0e937dda4e1..b3f2e97cd95 100644 --- a/paddle/fluid/framework/program_desc.cc +++ b/paddle/fluid/framework/program_desc.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/program_desc.h" -#include "paddle/framework/block_desc.h" -#include "paddle/framework/feed_fetch_type.h" +#include "paddle/fluid/framework/program_desc.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/feed_fetch_type.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/program_desc.h b/paddle/fluid/framework/program_desc.h index 8e958eab6ee..937de6ba927 100644 --- a/paddle/fluid/framework/program_desc.h +++ b/paddle/fluid/framework/program_desc.h @@ -16,10 +16,10 @@ limitations under the License. */ #include #include -#include "paddle/framework/block_desc.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/proto_desc.h" -#include "paddle/platform/macros.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/proto_desc.h" +#include "paddle/fluid/platform/macros.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/program_desc_test.cc b/paddle/fluid/framework/program_desc_test.cc index 9945aee31b6..afd5c9dabfb 100644 --- a/paddle/fluid/framework/program_desc_test.cc +++ b/paddle/fluid/framework/program_desc_test.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/program_desc.h" +#include "paddle/fluid/framework/program_desc.h" #include "gtest/gtest.h" -#include "paddle/framework/block_desc.h" +#include "paddle/fluid/framework/block_desc.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/prune.cc b/paddle/fluid/framework/prune.cc index ddd6b993d40..79dbd3bcab4 100644 --- a/paddle/fluid/framework/prune.cc +++ b/paddle/fluid/framework/prune.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/prune.h" +#include "paddle/fluid/framework/prune.h" #include #include diff --git a/paddle/fluid/framework/prune.h b/paddle/fluid/framework/prune.h index 593292523d0..601e66b67a7 100644 --- a/paddle/fluid/framework/prune.h +++ b/paddle/fluid/framework/prune.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/framework.pb.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/prune_test.cc b/paddle/fluid/framework/prune_test.cc index d76c5abca94..36b76f0763e 100644 --- a/paddle/fluid/framework/prune_test.cc +++ b/paddle/fluid/framework/prune_test.cc @@ -12,15 +12,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/prune.h" +#include "paddle/fluid/framework/prune.h" -#include "paddle/framework/attribute.h" -#include "paddle/framework/operator.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/framework/attribute.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/operators/net_op.h" -#include "paddle/framework/block_desc.h" -#include "paddle/framework/op_desc.h" -#include "paddle/framework/program_desc.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/op_desc.h" +#include "paddle/fluid/framework/program_desc.h" #include diff --git a/paddle/fluid/framework/reader.cc b/paddle/fluid/framework/reader.cc index 928b661aaad..96c563814c3 100644 --- a/paddle/fluid/framework/reader.cc +++ b/paddle/fluid/framework/reader.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/reader.h" +#include "paddle/fluid/framework/reader.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/reader.h b/paddle/fluid/framework/reader.h index 534894cfbd6..4a5eba5fb73 100644 --- a/paddle/fluid/framework/reader.h +++ b/paddle/fluid/framework/reader.h @@ -14,8 +14,8 @@ #pragma once -#include "paddle/framework/ddim.h" -#include "paddle/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/lod_tensor_array.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/scope.cc b/paddle/fluid/framework/scope.cc index af08b2ab816..6006ed16bd4 100644 --- a/paddle/fluid/framework/scope.cc +++ b/paddle/fluid/framework/scope.cc @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/scope.h" +#include "paddle/fluid/framework/scope.h" #include // for unique_ptr #include // for call_once #include "glog/logging.h" -#include "paddle/framework/threadpool.h" +#include "paddle/fluid/framework/threadpool.h" #include "paddle/string/printf.h" DEFINE_bool(benchmark, false, diff --git a/paddle/fluid/framework/scope.h b/paddle/fluid/framework/scope.h index a1da81cc797..2da9e0716e7 100644 --- a/paddle/fluid/framework/scope.h +++ b/paddle/fluid/framework/scope.h @@ -19,8 +19,8 @@ limitations under the License. */ #include #include -#include "paddle/framework/variable.h" -#include "paddle/platform/macros.h" +#include "paddle/fluid/framework/variable.h" +#include "paddle/fluid/platform/macros.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/scope_test.cc b/paddle/fluid/framework/scope_test.cc index 0f5b86061db..d64acb130cb 100644 --- a/paddle/fluid/framework/scope_test.cc +++ b/paddle/fluid/framework/scope_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/scope.h" +#include "paddle/fluid/framework/scope.h" #include "glog/logging.h" #include "gtest/gtest.h" diff --git a/paddle/fluid/framework/selected_rows.cc b/paddle/fluid/framework/selected_rows.cc index 3b3e60177a4..f5d9e9a4951 100644 --- a/paddle/fluid/framework/selected_rows.cc +++ b/paddle/fluid/framework/selected_rows.cc @@ -9,7 +9,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/selected_rows.h" +#include "paddle/fluid/framework/selected_rows.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/selected_rows.h b/paddle/fluid/framework/selected_rows.h index 30d3dfc1e89..f1a263962b2 100644 --- a/paddle/fluid/framework/selected_rows.h +++ b/paddle/fluid/framework/selected_rows.h @@ -10,8 +10,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/tensor.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/tensor.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/selected_rows_test.cc b/paddle/fluid/framework/selected_rows_test.cc index 8ff3fb6a971..d414f2a5934 100644 --- a/paddle/fluid/framework/selected_rows_test.cc +++ b/paddle/fluid/framework/selected_rows_test.cc @@ -9,7 +9,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/selected_rows.h" +#include "paddle/fluid/framework/selected_rows.h" #include "gtest/gtest.h" namespace paddle { diff --git a/paddle/fluid/framework/shape_inference.cc b/paddle/fluid/framework/shape_inference.cc index 2f4d4505771..ac7fc029737 100644 --- a/paddle/fluid/framework/shape_inference.cc +++ b/paddle/fluid/framework/shape_inference.cc @@ -11,9 +11,9 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/shape_inference.h" +#include "paddle/fluid/framework/shape_inference.h" #include "grad_op_desc_maker.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/shape_inference.h b/paddle/fluid/framework/shape_inference.h index 7bee8698523..a923463ce37 100644 --- a/paddle/fluid/framework/shape_inference.h +++ b/paddle/fluid/framework/shape_inference.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/attribute.h" -#include "paddle/framework/ddim.h" -#include "paddle/framework/framework.pb.h" +#include "paddle/fluid/framework/attribute.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/framework.pb.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/tensor.cc b/paddle/fluid/framework/tensor.cc index f922e606249..a56091d3c62 100644 --- a/paddle/fluid/framework/tensor.cc +++ b/paddle/fluid/framework/tensor.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/tensor.h" +#include "paddle/fluid/framework/tensor.h" namespace paddle { namespace framework {} diff --git a/paddle/fluid/framework/tensor.h b/paddle/fluid/framework/tensor.h index be09b7c9450..44d2c7dae94 100644 --- a/paddle/fluid/framework/tensor.h +++ b/paddle/fluid/framework/tensor.h @@ -20,12 +20,12 @@ limitations under the License. */ #include #include -#include "paddle/framework/data_layout.h" -#include "paddle/framework/ddim.h" -#include "paddle/memory/memory.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/data_layout.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/memory/memory.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/place.h" namespace paddle { @@ -224,4 +224,4 @@ inline void Tensor::switch_place(platform::Place new_place) { } // namespace framework } // namespace paddle -#include "paddle/framework/tensor_impl.h" +#include "paddle/fluid/framework/tensor_impl.h" diff --git a/paddle/fluid/framework/tensor_impl.h b/paddle/fluid/framework/tensor_impl.h index 652d6b8a90e..e69836292cd 100644 --- a/paddle/fluid/framework/tensor_impl.h +++ b/paddle/fluid/framework/tensor_impl.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/memory/memcpy.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/tensor_test.cc b/paddle/fluid/framework/tensor_test.cc index 9a387526ac2..6ed416e46f9 100644 --- a/paddle/fluid/framework/tensor_test.cc +++ b/paddle/fluid/framework/tensor_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/tensor.h" +#include "paddle/fluid/framework/tensor.h" #include #include diff --git a/paddle/fluid/framework/tensor_util.cc b/paddle/fluid/framework/tensor_util.cc index a5b83eaa07a..537fb4614ca 100644 --- a/paddle/fluid/framework/tensor_util.cc +++ b/paddle/fluid/framework/tensor_util.cc @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/tensor_util.h" +#include "paddle/fluid/framework/tensor_util.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/tensor_util.cu b/paddle/fluid/framework/tensor_util.cu deleted file mode 120000 index b00e6e59d93..00000000000 --- a/paddle/fluid/framework/tensor_util.cu +++ /dev/null @@ -1 +0,0 @@ -./tensor_util.cc \ No newline at end of file diff --git a/paddle/fluid/framework/tensor_util.cu b/paddle/fluid/framework/tensor_util.cu new file mode 100644 index 00000000000..537fb4614ca --- /dev/null +++ b/paddle/fluid/framework/tensor_util.cu @@ -0,0 +1,119 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ + +#include "paddle/fluid/framework/tensor_util.h" + +namespace paddle { +namespace framework { +template +struct AnyDTypeVisitor { + Predicate predicate_; + const Tensor& tensor_; + const DevCtx& ctx_; + Tensor* out_; + + AnyDTypeVisitor(Predicate predicate, const Tensor& tensor, const DevCtx& ctx, + Tensor* out) + : predicate_(predicate), tensor_(tensor), ctx_(ctx), out_(out) {} + + template + void operator()() const { + auto t = EigenVector::Flatten(tensor_); + auto o = EigenScalar::From(*out_); + // return any of predicate_(t) is true. + o.device(*ctx_.eigen_device()) = predicate_(t).any(); + } +}; + +template +inline void AnyImpl(Predicate predicate, const framework::Tensor& tensor, + const DevCtx& ctx, framework::Tensor* out) { + VisitDataType(ToDataType(tensor.type()), AnyDTypeVisitor( + predicate, tensor, ctx, out)); +} + +template +struct AnyVisitor : public boost::static_visitor { + const framework::Tensor& tensor_; + Predicate predicate_; + + AnyVisitor(const framework::Tensor& tensor, Predicate predicate) + : tensor_(tensor), predicate_(std::move(predicate)) {} + + template + bool operator()(const Place& place) const { + framework::Tensor out; + out.Resize({1}); + out.mutable_data(place); + auto* ctx = platform::DeviceContextPool::Instance().GetByPlace(place); + AnyImpl(predicate_, tensor_, *ctx, &out); + return this->GetResult(out, place); + } + + bool GetResult(const framework::Tensor& out, + const platform::CUDAPlace& gpu) const { + platform::CPUPlace cpu; + framework::Tensor tmp; + tmp.Resize({1}); + tmp.mutable_data(cpu); + auto gpuctx = platform::DeviceContextPool::Instance().Get(gpu); + gpuctx->Wait(); + Copy(out, cpu, *gpuctx, &tmp); + gpuctx->Wait(); + return GetResult(tmp, cpu); + } + + bool GetResult(const framework::Tensor& out, + const platform::CPUPlace& cpu) const { + return *out.data(); + } +}; + +template +inline bool Any(const framework::Tensor& tensor, Predicate predicate) { + AnyVisitor visitor(tensor, predicate); + auto place = tensor.place(); + return platform::VisitPlace(place, visitor); +} + +struct HasNANPredicate { + template + auto operator()(const T& eigen_vec) const + -> decltype(std::declval().isnan()) { + // Cast eigen_vector to vector of bool. true if is inf. + return eigen_vec.isnan(); + } +}; + +bool HasNAN(const framework::Tensor& tensor) { + HasNANPredicate predicate; + return Any(tensor, predicate); +} + +struct HasInfPredicate { + template + auto operator()(const T& eigen_vec) const + -> decltype(std::declval().isinf()) { + // Cast eigen_vector to vector of bool. true if is inf. + return eigen_vec.isinf(); + } +}; + +bool HasInf(const framework::Tensor& tensor) { + HasInfPredicate predicate; + return Any(tensor, predicate); +} + +} // namespace framework +} // namespace paddle diff --git a/paddle/fluid/framework/tensor_util.h b/paddle/fluid/framework/tensor_util.h index b49c6144998..b7e772b6daa 100644 --- a/paddle/fluid/framework/tensor_util.h +++ b/paddle/fluid/framework/tensor_util.h @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/data_type.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/tensor_util_test.cc b/paddle/fluid/framework/tensor_util_test.cc index 906b0b56563..8764c692e87 100644 --- a/paddle/fluid/framework/tensor_util_test.cc +++ b/paddle/fluid/framework/tensor_util_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/tensor_util.h" +#include "paddle/fluid/framework/tensor_util.h" #include #include #include diff --git a/paddle/fluid/framework/tensor_util_test.cu b/paddle/fluid/framework/tensor_util_test.cu index ebd35fdf6c2..1982b642bcd 100644 --- a/paddle/fluid/framework/tensor_util_test.cu +++ b/paddle/fluid/framework/tensor_util_test.cu @@ -13,9 +13,9 @@ limitations under the License. */ #include "gtest/gtest.h" -#include "paddle/framework/tensor_util.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/tensor_util.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/threadpool.cc b/paddle/fluid/framework/threadpool.cc index b7d7c00bcf9..2c4de41b0c4 100644 --- a/paddle/fluid/framework/threadpool.cc +++ b/paddle/fluid/framework/threadpool.cc @@ -12,9 +12,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/threadpool.h" +#include "paddle/fluid/framework/threadpool.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/threadpool.h b/paddle/fluid/framework/threadpool.h index 77d31a1176d..e88e6c01f02 100644 --- a/paddle/fluid/framework/threadpool.h +++ b/paddle/fluid/framework/threadpool.h @@ -22,8 +22,8 @@ limitations under the License. */ #include #include #include "glog/logging.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/macros.h" // for DISABLE_COPY_AND_ASSIGN +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/macros.h" // for DISABLE_COPY_AND_ASSIGN namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/type_defs.h b/paddle/fluid/framework/type_defs.h index 1eedbbc419a..786d78a6440 100644 --- a/paddle/fluid/framework/type_defs.h +++ b/paddle/fluid/framework/type_defs.h @@ -20,7 +20,7 @@ limitations under the License. */ #include #include #include -#include "paddle/platform/variant.h" +#include "paddle/fluid/platform/variant.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/var_desc.cc b/paddle/fluid/framework/var_desc.cc index 11a4daf2c99..7ec9b2ced94 100644 --- a/paddle/fluid/framework/var_desc.cc +++ b/paddle/fluid/framework/var_desc.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/var_desc.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/var_desc.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/var_desc.h b/paddle/fluid/framework/var_desc.h index 72da2fbb0a6..cdb1bc3ec09 100644 --- a/paddle/fluid/framework/var_desc.h +++ b/paddle/fluid/framework/var_desc.h @@ -16,7 +16,7 @@ limitations under the License. */ #include #include "glog/logging.h" -#include "paddle/framework/framework.pb.h" +#include "paddle/fluid/framework/framework.pb.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/var_type.h b/paddle/fluid/framework/var_type.h index 599d4514902..2dc4de52981 100644 --- a/paddle/fluid/framework/var_type.h +++ b/paddle/fluid/framework/var_type.h @@ -13,13 +13,13 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/reader.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/framework/variable.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/reader.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/framework/variable.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/var_type_inference.h b/paddle/fluid/framework/var_type_inference.h index 6c11f2fee7f..44fd4cd622c 100644 --- a/paddle/fluid/framework/var_type_inference.h +++ b/paddle/fluid/framework/var_type_inference.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/type_defs.h" +#include "paddle/fluid/framework/type_defs.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/var_type_inference_test.cc b/paddle/fluid/framework/var_type_inference_test.cc index fa6018b1c58..0ee589c821a 100644 --- a/paddle/fluid/framework/var_type_inference_test.cc +++ b/paddle/fluid/framework/var_type_inference_test.cc @@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/var_type_inference.h" +#include "paddle/fluid/framework/var_type_inference.h" #include "gtest/gtest.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/program_desc.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/program_desc.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/variable.h b/paddle/fluid/framework/variable.h index 3b7ec0a2a90..9fb8ca92d68 100644 --- a/paddle/fluid/framework/variable.h +++ b/paddle/fluid/framework/variable.h @@ -17,7 +17,7 @@ #include #include -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/variable_test.cc b/paddle/fluid/framework/variable_test.cc index e5585c8724d..8c14e506fd7 100644 --- a/paddle/fluid/framework/variable_test.cc +++ b/paddle/fluid/framework/variable_test.cc @@ -16,7 +16,7 @@ #include #include "gtest/gtest.h" -#include "paddle/framework/variable.h" +#include "paddle/fluid/framework/variable.h" TEST(Variable, GetMutable) { using paddle::framework::Variable; diff --git a/paddle/fluid/inference/io.cc b/paddle/fluid/inference/io.cc index 784e87970f7..58d7ab40bfa 100644 --- a/paddle/fluid/inference/io.cc +++ b/paddle/fluid/inference/io.cc @@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/inference/io.h" +#include "paddle/fluid/inference/io.h" #include -#include "paddle/framework/block_desc.h" -#include "paddle/framework/feed_fetch_type.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/feed_fetch_type.h" namespace paddle { namespace inference { diff --git a/paddle/fluid/inference/io.h b/paddle/fluid/inference/io.h index a7d7c499690..9d786406064 100644 --- a/paddle/fluid/inference/io.h +++ b/paddle/fluid/inference/io.h @@ -17,9 +17,9 @@ limitations under the License. */ #include #include #include -#include "paddle/framework/executor.h" -#include "paddle/framework/program_desc.h" -#include "paddle/framework/scope.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/program_desc.h" +#include "paddle/fluid/framework/scope.h" namespace paddle { namespace inference { diff --git a/paddle/fluid/inference/tests/book/test_helper.h b/paddle/fluid/inference/tests/book/test_helper.h index 02104306e71..d7401709516 100644 --- a/paddle/fluid/inference/tests/book/test_helper.h +++ b/paddle/fluid/inference/tests/book/test_helper.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/lod_tensor.h" -#include "paddle/inference/io.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/inference/io.h" template void SetupTensor(paddle::framework::LoDTensor& input, diff --git a/paddle/fluid/memory/.clang-format b/paddle/fluid/memory/.clang-format deleted file mode 120000 index 7d28cb39247..00000000000 --- a/paddle/fluid/memory/.clang-format +++ /dev/null @@ -1 +0,0 @@ -../framework/.clang-format \ No newline at end of file diff --git a/paddle/fluid/memory/.clang-format b/paddle/fluid/memory/.clang-format new file mode 100644 index 00000000000..29282dc87e2 --- /dev/null +++ b/paddle/fluid/memory/.clang-format @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: Google +Standard: Cpp11 +... diff --git a/paddle/fluid/memory/detail/buddy_allocator.cc b/paddle/fluid/memory/detail/buddy_allocator.cc index 2bc2c06a157..2cee8271d27 100644 --- a/paddle/fluid/memory/detail/buddy_allocator.cc +++ b/paddle/fluid/memory/detail/buddy_allocator.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/detail/buddy_allocator.h" +#include "paddle/fluid/memory/detail/buddy_allocator.h" #include "glog/logging.h" namespace paddle { diff --git a/paddle/fluid/memory/detail/buddy_allocator.h b/paddle/fluid/memory/detail/buddy_allocator.h index 4e0135dd655..644d7933068 100644 --- a/paddle/fluid/memory/detail/buddy_allocator.h +++ b/paddle/fluid/memory/detail/buddy_allocator.h @@ -14,12 +14,12 @@ limitations under the License. */ #pragma once -#include "paddle/memory/detail/meta_cache.h" -#include "paddle/memory/detail/meta_data.h" -#include "paddle/memory/detail/system_allocator.h" -#include "paddle/platform/assert.h" -#include "paddle/platform/cpu_info.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/memory/detail/meta_cache.h" +#include "paddle/fluid/memory/detail/meta_data.h" +#include "paddle/fluid/memory/detail/system_allocator.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/cpu_info.h" +#include "paddle/fluid/platform/gpu_info.h" #include #include diff --git a/paddle/fluid/memory/detail/memory_block.cc b/paddle/fluid/memory/detail/memory_block.cc index f50eceba096..23388cdd5b7 100644 --- a/paddle/fluid/memory/detail/memory_block.cc +++ b/paddle/fluid/memory/detail/memory_block.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/detail/memory_block.h" -#include "paddle/memory/detail/meta_cache.h" -#include "paddle/memory/detail/meta_data.h" -#include "paddle/platform/assert.h" +#include "paddle/fluid/memory/detail/memory_block.h" +#include "paddle/fluid/memory/detail/meta_cache.h" +#include "paddle/fluid/memory/detail/meta_data.h" +#include "paddle/fluid/platform/assert.h" namespace paddle { namespace memory { diff --git a/paddle/fluid/memory/detail/meta_cache.cc b/paddle/fluid/memory/detail/meta_cache.cc index 2bacca75108..7d78811c771 100644 --- a/paddle/fluid/memory/detail/meta_cache.cc +++ b/paddle/fluid/memory/detail/meta_cache.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/detail/meta_cache.h" +#include "paddle/fluid/memory/detail/meta_cache.h" #include "glog/logging.h" -#include "paddle/memory/detail/memory_block.h" -#include "paddle/platform/assert.h" +#include "paddle/fluid/memory/detail/memory_block.h" +#include "paddle/fluid/platform/assert.h" namespace paddle { namespace memory { diff --git a/paddle/fluid/memory/detail/meta_cache.h b/paddle/fluid/memory/detail/meta_cache.h index db8ffd49ae3..635d6398e69 100644 --- a/paddle/fluid/memory/detail/meta_cache.h +++ b/paddle/fluid/memory/detail/meta_cache.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/memory/detail/memory_block.h" -#include "paddle/memory/detail/meta_data.h" +#include "paddle/fluid/memory/detail/memory_block.h" +#include "paddle/fluid/memory/detail/meta_data.h" #include diff --git a/paddle/fluid/memory/detail/meta_data.cc b/paddle/fluid/memory/detail/meta_data.cc index dc57d4d2376..eae49ebdcff 100644 --- a/paddle/fluid/memory/detail/meta_data.cc +++ b/paddle/fluid/memory/detail/meta_data.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/detail/meta_data.h" +#include "paddle/fluid/memory/detail/meta_data.h" #include diff --git a/paddle/fluid/memory/detail/meta_data.h b/paddle/fluid/memory/detail/meta_data.h index 6b83c42eb85..368523701ef 100644 --- a/paddle/fluid/memory/detail/meta_data.h +++ b/paddle/fluid/memory/detail/meta_data.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/memory/detail/memory_block.h" +#include "paddle/fluid/memory/detail/memory_block.h" #include diff --git a/paddle/fluid/memory/detail/system_allocator.cc b/paddle/fluid/memory/detail/system_allocator.cc index 509250debc2..1f07c5e789c 100644 --- a/paddle/fluid/memory/detail/system_allocator.cc +++ b/paddle/fluid/memory/detail/system_allocator.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/detail/system_allocator.h" -#include "paddle/platform/assert.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/memory/detail/system_allocator.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/gpu_info.h" #include // for malloc and free #include // for mlock and munlock diff --git a/paddle/fluid/memory/detail/system_allocator_test.cc b/paddle/fluid/memory/detail/system_allocator_test.cc index 6a8558937bf..a850e480ec9 100644 --- a/paddle/fluid/memory/detail/system_allocator_test.cc +++ b/paddle/fluid/memory/detail/system_allocator_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/detail/system_allocator.h" +#include "paddle/fluid/memory/detail/system_allocator.h" #include #include diff --git a/paddle/fluid/memory/memcpy.cc b/paddle/fluid/memory/memcpy.cc index b46141aafd7..8938b361337 100644 --- a/paddle/fluid/memory/memcpy.cc +++ b/paddle/fluid/memory/memcpy.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/memcpy.h" +#include "paddle/fluid/memory/memcpy.h" #include // for memcpy diff --git a/paddle/fluid/memory/memcpy.h b/paddle/fluid/memory/memcpy.h index 29c20e18601..77d209c3fbe 100644 --- a/paddle/fluid/memory/memcpy.h +++ b/paddle/fluid/memory/memcpy.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/platform/gpu_info.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/platform/gpu_info.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace memory { diff --git a/paddle/fluid/memory/memory.cc b/paddle/fluid/memory/memory.cc index 1a73a94567e..6eedab5d034 100644 --- a/paddle/fluid/memory/memory.cc +++ b/paddle/fluid/memory/memory.cc @@ -12,13 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/memory.h" +#include "paddle/fluid/memory/memory.h" #include "glog/logging.h" -#include "paddle/memory/detail/buddy_allocator.h" -#include "paddle/memory/detail/system_allocator.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/memory/detail/buddy_allocator.h" +#include "paddle/fluid/memory/detail/system_allocator.h" +#include "paddle/fluid/platform/gpu_info.h" DECLARE_double(fraction_of_gpu_memory_to_use); diff --git a/paddle/fluid/memory/memory.h b/paddle/fluid/memory/memory.h index 30ed68c6e0e..a9166a6746e 100644 --- a/paddle/fluid/memory/memory.h +++ b/paddle/fluid/memory/memory.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/platform/place.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace memory { diff --git a/paddle/fluid/memory/memory_test.cc b/paddle/fluid/memory/memory_test.cc index b3f699f9b7e..d7505ef0f36 100644 --- a/paddle/fluid/memory/memory_test.cc +++ b/paddle/fluid/memory/memory_test.cc @@ -12,13 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/memory/memory.h" -#include "paddle/memory/detail/memory_block.h" -#include "paddle/memory/detail/meta_data.h" +#include "paddle/fluid/memory/memory.h" +#include "paddle/fluid/memory/detail/memory_block.h" +#include "paddle/fluid/memory/detail/meta_data.h" -#include "paddle/platform/cpu_info.h" -#include "paddle/platform/gpu_info.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/platform/cpu_info.h" +#include "paddle/fluid/platform/gpu_info.h" +#include "paddle/fluid/platform/place.h" #include #include diff --git a/paddle/fluid/operators/.clang-format b/paddle/fluid/operators/.clang-format deleted file mode 120000 index 7d28cb39247..00000000000 --- a/paddle/fluid/operators/.clang-format +++ /dev/null @@ -1 +0,0 @@ -../framework/.clang-format \ No newline at end of file diff --git a/paddle/fluid/operators/.clang-format b/paddle/fluid/operators/.clang-format new file mode 100644 index 00000000000..29282dc87e2 --- /dev/null +++ b/paddle/fluid/operators/.clang-format @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: Google +Standard: Cpp11 +... diff --git a/paddle/fluid/operators/accuracy_op.cc b/paddle/fluid/operators/accuracy_op.cc index 8e8a3c7dd30..43689b3b7da 100644 --- a/paddle/fluid/operators/accuracy_op.cc +++ b/paddle/fluid/operators/accuracy_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/accuracy_op.h" +#include "paddle/fluid/operators/accuracy_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/accuracy_op.cu b/paddle/fluid/operators/accuracy_op.cu index 0aadd5af415..4462b9ba5c0 100644 --- a/paddle/fluid/operators/accuracy_op.cu +++ b/paddle/fluid/operators/accuracy_op.cu @@ -14,9 +14,9 @@ limitations under the License. */ #include #include -#include "paddle/operators/accuracy_op.h" -#include "paddle/platform/cuda_helper.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/operators/accuracy_op.h" +#include "paddle/fluid/platform/cuda_helper.h" +#include "paddle/fluid/platform/gpu_info.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/accuracy_op.h b/paddle/fluid/operators/accuracy_op.h index 04104a695fa..b3ed1d3fe09 100644 --- a/paddle/fluid/operators/accuracy_op.h +++ b/paddle/fluid/operators/accuracy_op.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/activation_op.cc b/paddle/fluid/operators/activation_op.cc index 4188858a90d..c04dd8cb916 100644 --- a/paddle/fluid/operators/activation_op.cc +++ b/paddle/fluid/operators/activation_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/activation_op.h" +#include "paddle/fluid/operators/activation_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/activation_op.cu b/paddle/fluid/operators/activation_op.cu index b9ccdf639cf..b86a7926a97 100644 --- a/paddle/fluid/operators/activation_op.cu +++ b/paddle/fluid/operators/activation_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/activation_op.h" +#include "paddle/fluid/operators/activation_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/activation_op.h b/paddle/fluid/operators/activation_op.h index c0809abc051..7a6ae2224c8 100644 --- a/paddle/fluid/operators/activation_op.h +++ b/paddle/fluid/operators/activation_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/detail/safe_ref.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/detail/safe_ref.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adadelta_op.cc b/paddle/fluid/operators/adadelta_op.cc index d8a9491c824..ececd47e6a6 100644 --- a/paddle/fluid/operators/adadelta_op.cc +++ b/paddle/fluid/operators/adadelta_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/adadelta_op.h" +#include "paddle/fluid/operators/adadelta_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adadelta_op.cu b/paddle/fluid/operators/adadelta_op.cu index 91294a0d5d1..733482f788d 100644 --- a/paddle/fluid/operators/adadelta_op.cu +++ b/paddle/fluid/operators/adadelta_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/adadelta_op.h" +#include "paddle/fluid/operators/adadelta_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/adadelta_op.h b/paddle/fluid/operators/adadelta_op.h index 819d0845dbd..82ced087104 100644 --- a/paddle/fluid/operators/adadelta_op.h +++ b/paddle/fluid/operators/adadelta_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adagrad_op.cc b/paddle/fluid/operators/adagrad_op.cc index c83318a2723..61c0ecd019b 100644 --- a/paddle/fluid/operators/adagrad_op.cc +++ b/paddle/fluid/operators/adagrad_op.cc @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/adagrad_op.h" +#include "paddle/fluid/operators/adagrad_op.h" #include -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/selected_rows_functor.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adagrad_op.cu b/paddle/fluid/operators/adagrad_op.cu index 9a21e00b12b..1117363c133 100644 --- a/paddle/fluid/operators/adagrad_op.cu +++ b/paddle/fluid/operators/adagrad_op.cu @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/adagrad_op.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/selected_rows_functor.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/adagrad_op.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adagrad_op.h b/paddle/fluid/operators/adagrad_op.h index 66f5b0f449a..ee503b2c362 100644 --- a/paddle/fluid/operators/adagrad_op.h +++ b/paddle/fluid/operators/adagrad_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adam_op.cc b/paddle/fluid/operators/adam_op.cc index 03527de936b..25da9336b28 100644 --- a/paddle/fluid/operators/adam_op.cc +++ b/paddle/fluid/operators/adam_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/adam_op.h" +#include "paddle/fluid/operators/adam_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adam_op.cu b/paddle/fluid/operators/adam_op.cu index 94f840c1889..85b806eb6a1 100644 --- a/paddle/fluid/operators/adam_op.cu +++ b/paddle/fluid/operators/adam_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/adam_op.h" +#include "paddle/fluid/operators/adam_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/adam_op.h b/paddle/fluid/operators/adam_op.h index af2c3ecd725..a51b46ef157 100644 --- a/paddle/fluid/operators/adam_op.h +++ b/paddle/fluid/operators/adam_op.h @@ -14,10 +14,10 @@ limitations under the License. */ #pragma once #include // for sqrt in CPU and CUDA -#include "paddle/framework/op_registry.h" -#include "paddle/operators/detail/safe_ref.h" -#include "paddle/operators/math/selected_rows_functor.h" -#include "paddle/platform/for_range.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/detail/safe_ref.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" +#include "paddle/fluid/platform/for_range.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adamax_op.cc b/paddle/fluid/operators/adamax_op.cc index 3b0b7141847..b2249b8f96d 100644 --- a/paddle/fluid/operators/adamax_op.cc +++ b/paddle/fluid/operators/adamax_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/adamax_op.h" +#include "paddle/fluid/operators/adamax_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/adamax_op.cu b/paddle/fluid/operators/adamax_op.cu index 8f87bb28671..44a5d6c7bde 100644 --- a/paddle/fluid/operators/adamax_op.cu +++ b/paddle/fluid/operators/adamax_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/adamax_op.h" +#include "paddle/fluid/operators/adamax_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/adamax_op.h b/paddle/fluid/operators/adamax_op.h index 172c179c5fa..124453c0ece 100644 --- a/paddle/fluid/operators/adamax_op.h +++ b/paddle/fluid/operators/adamax_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/array_operator.h b/paddle/fluid/operators/array_operator.h index 3fdad5ad9b1..4ffb414ecea 100644 --- a/paddle/fluid/operators/array_operator.h +++ b/paddle/fluid/operators/array_operator.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/array_to_lod_tensor_op.cc b/paddle/fluid/operators/array_to_lod_tensor_op.cc index ba5c6bd3c68..bf8e11bd8c0 100644 --- a/paddle/fluid/operators/array_to_lod_tensor_op.cc +++ b/paddle/fluid/operators/array_to_lod_tensor_op.cc @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" -#include "paddle/memory/memcpy.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/assign_op.cc b/paddle/fluid/operators/assign_op.cc index e04aa2d28cf..f99f9af4276 100644 --- a/paddle/fluid/operators/assign_op.cc +++ b/paddle/fluid/operators/assign_op.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/data_type.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/var_type.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/var_type.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/assign_value_op.cc b/paddle/fluid/operators/assign_value_op.cc index 8e3a5304892..835043d9ab4 100644 --- a/paddle/fluid/operators/assign_value_op.cc +++ b/paddle/fluid/operators/assign_value_op.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/operators/assign_value_op.h" +#include "paddle/fluid/operators/assign_value_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/assign_value_op.cu.cc b/paddle/fluid/operators/assign_value_op.cu.cc index b17e2015005..616163f97b9 100644 --- a/paddle/fluid/operators/assign_value_op.cu.cc +++ b/paddle/fluid/operators/assign_value_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/assign_value_op.h" +#include "paddle/fluid/operators/assign_value_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL(assign_value, ops::AssignValueKernel, diff --git a/paddle/fluid/operators/assign_value_op.h b/paddle/fluid/operators/assign_value_op.h index ec98c535132..33a344cad59 100644 --- a/paddle/fluid/operators/assign_value_op.h +++ b/paddle/fluid/operators/assign_value_op.h @@ -14,9 +14,9 @@ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/auc_op.cc b/paddle/fluid/operators/auc_op.cc index b6494f95097..8ac08ea4a19 100644 --- a/paddle/fluid/operators/auc_op.cc +++ b/paddle/fluid/operators/auc_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/auc_op.h" +#include "paddle/fluid/operators/auc_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/auc_op.h b/paddle/fluid/operators/auc_op.h index b80509e2a99..e648db70974 100644 --- a/paddle/fluid/operators/auc_op.h +++ b/paddle/fluid/operators/auc_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/batch_norm_op.cc b/paddle/fluid/operators/batch_norm_op.cc index 0e984c38ba7..506c25d50d4 100644 --- a/paddle/fluid/operators/batch_norm_op.cc +++ b/paddle/fluid/operators/batch_norm_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/batch_norm_op.h" -#include "paddle/framework/data_layout.h" +#include "paddle/fluid/operators/batch_norm_op.h" +#include "paddle/fluid/framework/data_layout.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/batch_norm_op.cu.cc b/paddle/fluid/operators/batch_norm_op.cu.cc index 3d17725ab47..b9c97211e14 100644 --- a/paddle/fluid/operators/batch_norm_op.cu.cc +++ b/paddle/fluid/operators/batch_norm_op.cu.cc @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/batch_norm_op.h" -#include "paddle/framework/data_layout.h" +#include "paddle/fluid/operators/batch_norm_op.h" +#include "paddle/fluid/framework/data_layout.h" #include -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/cudnn_helper.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/cudnn_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/batch_norm_op.h b/paddle/fluid/operators/batch_norm_op.h index a817ef41fc8..fa9942ad099 100644 --- a/paddle/fluid/operators/batch_norm_op.h +++ b/paddle/fluid/operators/batch_norm_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/beam_search_decode_op.cc b/paddle/fluid/operators/beam_search_decode_op.cc index 72e05607b0b..7737d4e098a 100644 --- a/paddle/fluid/operators/beam_search_decode_op.cc +++ b/paddle/fluid/operators/beam_search_decode_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/beam_search_decode_op.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/operators/beam_search_decode_op.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/beam_search_decode_op.h b/paddle/fluid/operators/beam_search_decode_op.h index 3b1c6cd7a10..aeecb8d39ac 100644 --- a/paddle/fluid/operators/beam_search_decode_op.h +++ b/paddle/fluid/operators/beam_search_decode_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/beam_search_decode_op_test.cc b/paddle/fluid/operators/beam_search_decode_op_test.cc index 5ac23991f3c..24f87279d5e 100644 --- a/paddle/fluid/operators/beam_search_decode_op_test.cc +++ b/paddle/fluid/operators/beam_search_decode_op_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/beam_search_decode_op.h" +#include "paddle/fluid/operators/beam_search_decode_op.h" #include "gtest/gtest.h" using CPUPlace = paddle::platform::CPUPlace; diff --git a/paddle/fluid/operators/beam_search_op.cc b/paddle/fluid/operators/beam_search_op.cc index 844ade40eb2..6f4c8c7e06e 100644 --- a/paddle/fluid/operators/beam_search_op.cc +++ b/paddle/fluid/operators/beam_search_op.cc @@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/beam_search_op.h" +#include "paddle/fluid/operators/beam_search_op.h" #include -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/beam_search_op.h b/paddle/fluid/operators/beam_search_op.h index 7ad85874fcb..9e2a05a60c3 100644 --- a/paddle/fluid/operators/beam_search_op.h +++ b/paddle/fluid/operators/beam_search_op.h @@ -18,8 +18,8 @@ limitations under the License. */ #include "gtest/gtest.h" #endif -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/beam_search_op_test.cc b/paddle/fluid/operators/beam_search_op_test.cc index d4beb64a85a..ea2afda4d49 100644 --- a/paddle/fluid/operators/beam_search_op_test.cc +++ b/paddle/fluid/operators/beam_search_op_test.cc @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/beam_search_op.h" +#include "paddle/fluid/operators/beam_search_op.h" #include #include diff --git a/paddle/fluid/operators/bilinear_tensor_product_op.cc b/paddle/fluid/operators/bilinear_tensor_product_op.cc index 7640147a12d..cc378b1b453 100644 --- a/paddle/fluid/operators/bilinear_tensor_product_op.cc +++ b/paddle/fluid/operators/bilinear_tensor_product_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/bilinear_tensor_product_op.h" +#include "paddle/fluid/operators/bilinear_tensor_product_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/bilinear_tensor_product_op.cu b/paddle/fluid/operators/bilinear_tensor_product_op.cu index 0f48010716f..2cec48ee69a 100644 --- a/paddle/fluid/operators/bilinear_tensor_product_op.cu +++ b/paddle/fluid/operators/bilinear_tensor_product_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/bilinear_tensor_product_op.h" +#include "paddle/fluid/operators/bilinear_tensor_product_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/bilinear_tensor_product_op.h b/paddle/fluid/operators/bilinear_tensor_product_op.h index ba9a2c5ce3c..626fa957c42 100644 --- a/paddle/fluid/operators/bilinear_tensor_product_op.h +++ b/paddle/fluid/operators/bilinear_tensor_product_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/bipartite_match_op.cc b/paddle/fluid/operators/bipartite_match_op.cc index 1e6fa2091de..d614bf70438 100644 --- a/paddle/fluid/operators/bipartite_match_op.cc +++ b/paddle/fluid/operators/bipartite_match_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/box_coder_op.cc b/paddle/fluid/operators/box_coder_op.cc index 539813d4858..8e0fee22d8d 100644 --- a/paddle/fluid/operators/box_coder_op.cc +++ b/paddle/fluid/operators/box_coder_op.cc @@ -9,7 +9,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/box_coder_op.h" +#include "paddle/fluid/operators/box_coder_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/box_coder_op.cu b/paddle/fluid/operators/box_coder_op.cu index 98bd93457fa..dd9299ceacd 100644 --- a/paddle/fluid/operators/box_coder_op.cu +++ b/paddle/fluid/operators/box_coder_op.cu @@ -9,8 +9,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/box_coder_op.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/box_coder_op.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/box_coder_op.h b/paddle/fluid/operators/box_coder_op.h index 086251f6e06..c41bcc212b8 100644 --- a/paddle/fluid/operators/box_coder_op.h +++ b/paddle/fluid/operators/box_coder_op.h @@ -10,8 +10,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cast_op.cc b/paddle/fluid/operators/cast_op.cc index 446976edafc..364c21f7619 100644 --- a/paddle/fluid/operators/cast_op.cc +++ b/paddle/fluid/operators/cast_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cast_op.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/operators/cast_op.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cast_op.cu b/paddle/fluid/operators/cast_op.cu index d68bbe6e39a..fb597be9d93 100644 --- a/paddle/fluid/operators/cast_op.cu +++ b/paddle/fluid/operators/cast_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cast_op.h" +#include "paddle/fluid/operators/cast_op.h" template using CastOpKernel = diff --git a/paddle/fluid/operators/cast_op.h b/paddle/fluid/operators/cast_op.h index 9f39d91edd4..9ab4961cef4 100644 --- a/paddle/fluid/operators/cast_op.h +++ b/paddle/fluid/operators/cast_op.h @@ -14,10 +14,10 @@ limitations under the License. */ #pragma once -#include "paddle/framework/data_type.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/chunk_eval_op.cc b/paddle/fluid/operators/chunk_eval_op.cc index 44f667aead9..080e4d80da4 100644 --- a/paddle/fluid/operators/chunk_eval_op.cc +++ b/paddle/fluid/operators/chunk_eval_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/chunk_eval_op.h" +#include "paddle/fluid/operators/chunk_eval_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/chunk_eval_op.h b/paddle/fluid/operators/chunk_eval_op.h index 300aff90c0a..3dca3d2c0f9 100644 --- a/paddle/fluid/operators/chunk_eval_op.h +++ b/paddle/fluid/operators/chunk_eval_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/clip_by_norm_op.cc b/paddle/fluid/operators/clip_by_norm_op.cc index b90921d79ba..89df118c06f 100644 --- a/paddle/fluid/operators/clip_by_norm_op.cc +++ b/paddle/fluid/operators/clip_by_norm_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/clip_by_norm_op.h" +#include "paddle/fluid/operators/clip_by_norm_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/clip_by_norm_op.cu b/paddle/fluid/operators/clip_by_norm_op.cu index cbf8fa44133..a466b335914 100644 --- a/paddle/fluid/operators/clip_by_norm_op.cu +++ b/paddle/fluid/operators/clip_by_norm_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/clip_by_norm_op.h" +#include "paddle/fluid/operators/clip_by_norm_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/clip_by_norm_op.h b/paddle/fluid/operators/clip_by_norm_op.h index 87956a707cf..82bcf07657b 100644 --- a/paddle/fluid/operators/clip_by_norm_op.h +++ b/paddle/fluid/operators/clip_by_norm_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/clip_op.cc b/paddle/fluid/operators/clip_op.cc index 7adb74eab78..76b2cefbf9d 100644 --- a/paddle/fluid/operators/clip_op.cc +++ b/paddle/fluid/operators/clip_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/clip_op.h" +#include "paddle/fluid/operators/clip_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/clip_op.cu b/paddle/fluid/operators/clip_op.cu index 5ccbc964340..7b044d6e699 100644 --- a/paddle/fluid/operators/clip_op.cu +++ b/paddle/fluid/operators/clip_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/clip_op.h" +#include "paddle/fluid/operators/clip_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/clip_op.h b/paddle/fluid/operators/clip_op.h index 51db185dffd..aecd6f83bfa 100644 --- a/paddle/fluid/operators/clip_op.h +++ b/paddle/fluid/operators/clip_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/compare_op.cc b/paddle/fluid/operators/compare_op.cc index 51b5bcb38f9..f3414c33b5a 100644 --- a/paddle/fluid/operators/compare_op.cc +++ b/paddle/fluid/operators/compare_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/compare_op.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/operators/compare_op.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/compare_op.cu b/paddle/fluid/operators/compare_op.cu index f625824dbc9..3507af2ae3a 100644 --- a/paddle/fluid/operators/compare_op.cu +++ b/paddle/fluid/operators/compare_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/compare_op.h" +#include "paddle/fluid/operators/compare_op.h" REGISTER_LOGICAL_KERNEL(less_than, CUDA, paddle::operators::LessThanFunctor); REGISTER_LOGICAL_KERNEL(less_equal, CUDA, paddle::operators::LessEqualFunctor); diff --git a/paddle/fluid/operators/compare_op.h b/paddle/fluid/operators/compare_op.h index 79b8c6f59c7..4b2ee5a9d68 100644 --- a/paddle/fluid/operators/compare_op.h +++ b/paddle/fluid/operators/compare_op.h @@ -15,9 +15,9 @@ limitations under the License. */ #pragma once #include #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/elementwise_op_function.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/elementwise_op_function.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/concat_op.cc b/paddle/fluid/operators/concat_op.cc index 32b61edfd0d..68eb5412beb 100644 --- a/paddle/fluid/operators/concat_op.cc +++ b/paddle/fluid/operators/concat_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/concat_op.h" +#include "paddle/fluid/operators/concat_op.h" #include namespace paddle { diff --git a/paddle/fluid/operators/concat_op.cu.cc b/paddle/fluid/operators/concat_op.cu.cc index 7b46452d3d5..143bda61167 100644 --- a/paddle/fluid/operators/concat_op.cu.cc +++ b/paddle/fluid/operators/concat_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/concat_op.h" +#include "paddle/fluid/operators/concat_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( concat, ops::ConcatKernel); diff --git a/paddle/fluid/operators/concat_op.h b/paddle/fluid/operators/concat_op.h index de4011585af..72b3e225bf6 100644 --- a/paddle/fluid/operators/concat_op.h +++ b/paddle/fluid/operators/concat_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/strided_memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cond_op.cc b/paddle/fluid/operators/cond_op.cc index e333002bfd1..dd93790d5b5 100644 --- a/paddle/fluid/operators/cond_op.cc +++ b/paddle/fluid/operators/cond_op.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cond_op.h" -#include "paddle/operators/gather.h" -#include "paddle/operators/scatter.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/operators/cond_op.h" +#include "paddle/fluid/operators/gather.h" +#include "paddle/fluid/operators/scatter.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cond_op.h b/paddle/fluid/operators/cond_op.h index 7dcdc47e0b2..695af449069 100644 --- a/paddle/fluid/operators/cond_op.h +++ b/paddle/fluid/operators/cond_op.h @@ -15,11 +15,11 @@ limitations under the License. */ #pragma once #include #include "glog/logging.h" -#include "paddle/framework/ddim.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/tensor.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/operators/net_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conditional_block_op.cc b/paddle/fluid/operators/conditional_block_op.cc index bdcdb85be7a..30435c6cca0 100644 --- a/paddle/fluid/operators/conditional_block_op.cc +++ b/paddle/fluid/operators/conditional_block_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/executor.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_cudnn_op.cu.cc b/paddle/fluid/operators/conv_cudnn_op.cu.cc index 3a5409a7e3f..a729d376ac8 100644 --- a/paddle/fluid/operators/conv_cudnn_op.cu.cc +++ b/paddle/fluid/operators/conv_cudnn_op.cu.cc @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/memory/memory.h" -#include "paddle/operators/conv_op.h" -#include "paddle/platform/assert.h" -#include "paddle/platform/cudnn_helper.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/memory/memory.h" +#include "paddle/fluid/operators/conv_op.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/cudnn_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_op.cc b/paddle/fluid/operators/conv_op.cc index cef7ddd5fe7..a047e579163 100644 --- a/paddle/fluid/operators/conv_op.cc +++ b/paddle/fluid/operators/conv_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/conv_op.h" +#include "paddle/fluid/operators/conv_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_op.cu.cc b/paddle/fluid/operators/conv_op.cu.cc index d0bd40ee95d..b2129d3b461 100644 --- a/paddle/fluid/operators/conv_op.cu.cc +++ b/paddle/fluid/operators/conv_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/conv_op.h" +#include "paddle/fluid/operators/conv_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/conv_op.h b/paddle/fluid/operators/conv_op.h index 3c1d0e9c1c4..1156e6c8fe3 100644 --- a/paddle/fluid/operators/conv_op.h +++ b/paddle/fluid/operators/conv_op.h @@ -14,12 +14,12 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/depthwise_conv.h" -#include "paddle/operators/math/im2col.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/vol2col.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/depthwise_conv.h" +#include "paddle/fluid/operators/math/im2col.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/vol2col.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_shift_op.cc b/paddle/fluid/operators/conv_shift_op.cc index 106b68a0a0e..a96aac63e09 100644 --- a/paddle/fluid/operators/conv_shift_op.cc +++ b/paddle/fluid/operators/conv_shift_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/conv_shift_op.h" -#include "paddle/framework/eigen.h" +#include "paddle/fluid/operators/conv_shift_op.h" +#include "paddle/fluid/framework/eigen.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_shift_op.cu b/paddle/fluid/operators/conv_shift_op.cu index cf7abc196e1..9818707ce3b 100644 --- a/paddle/fluid/operators/conv_shift_op.cu +++ b/paddle/fluid/operators/conv_shift_op.cu @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/conv_shift_op.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/conv_shift_op.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_shift_op.h b/paddle/fluid/operators/conv_shift_op.h index 6781d87ef0d..987a690895e 100644 --- a/paddle/fluid/operators/conv_shift_op.h +++ b/paddle/fluid/operators/conv_shift_op.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_transpose_cudnn_op.cu.cc b/paddle/fluid/operators/conv_transpose_cudnn_op.cu.cc index 23bc97e13c1..0aed4ebeffa 100644 --- a/paddle/fluid/operators/conv_transpose_cudnn_op.cu.cc +++ b/paddle/fluid/operators/conv_transpose_cudnn_op.cu.cc @@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/memory/memory.h" -#include "paddle/operators/conv_transpose_op.h" -#include "paddle/platform/assert.h" -#include "paddle/platform/cudnn_helper.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/memory/memory.h" +#include "paddle/fluid/operators/conv_transpose_op.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/cudnn_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_transpose_op.cc b/paddle/fluid/operators/conv_transpose_op.cc index 089290a506d..974cffad928 100644 --- a/paddle/fluid/operators/conv_transpose_op.cc +++ b/paddle/fluid/operators/conv_transpose_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/conv_transpose_op.h" +#include "paddle/fluid/operators/conv_transpose_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/conv_transpose_op.cu.cc b/paddle/fluid/operators/conv_transpose_op.cu.cc index f1d827c6062..ed90c6ec626 100644 --- a/paddle/fluid/operators/conv_transpose_op.cu.cc +++ b/paddle/fluid/operators/conv_transpose_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/conv_transpose_op.h" +#include "paddle/fluid/operators/conv_transpose_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/conv_transpose_op.h b/paddle/fluid/operators/conv_transpose_op.h index 8c0d57afcd2..f5125754686 100644 --- a/paddle/fluid/operators/conv_transpose_op.h +++ b/paddle/fluid/operators/conv_transpose_op.h @@ -14,11 +14,11 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/im2col.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/vol2col.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/im2col.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/vol2col.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cos_sim_op.cc b/paddle/fluid/operators/cos_sim_op.cc index 9019a1edb37..57c5a6025a0 100644 --- a/paddle/fluid/operators/cos_sim_op.cc +++ b/paddle/fluid/operators/cos_sim_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cos_sim_op.h" +#include "paddle/fluid/operators/cos_sim_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cos_sim_op.cu b/paddle/fluid/operators/cos_sim_op.cu index 9e5d1b6e4f0..c8cf363cdc4 100644 --- a/paddle/fluid/operators/cos_sim_op.cu +++ b/paddle/fluid/operators/cos_sim_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/cos_sim_op.h" +#include "paddle/fluid/operators/cos_sim_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/cos_sim_op.h b/paddle/fluid/operators/cos_sim_op.h index eadcca55f9b..9cd8b196daf 100644 --- a/paddle/fluid/operators/cos_sim_op.h +++ b/paddle/fluid/operators/cos_sim_op.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/cos_sim_functor.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/for_range.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/cos_sim_functor.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/for_range.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/create_reader_op.cc b/paddle/fluid/operators/create_reader_op.cc index 5ba2a25ab4c..2927ea2dafa 100644 --- a/paddle/fluid/operators/create_reader_op.cc +++ b/paddle/fluid/operators/create_reader_op.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/op_registry.h" -#include "paddle/framework/reader.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/reader.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/crf_decoding_op.cc b/paddle/fluid/operators/crf_decoding_op.cc index 30626028c13..e3c1fc95a3b 100644 --- a/paddle/fluid/operators/crf_decoding_op.cc +++ b/paddle/fluid/operators/crf_decoding_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/crf_decoding_op.h" +#include "paddle/fluid/operators/crf_decoding_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/crf_decoding_op.h b/paddle/fluid/operators/crf_decoding_op.h index ce2f4e6622c..c3c161eec5f 100644 --- a/paddle/fluid/operators/crf_decoding_op.h +++ b/paddle/fluid/operators/crf_decoding_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/crop_op.cc b/paddle/fluid/operators/crop_op.cc index 310e3514431..8e80f77e497 100644 --- a/paddle/fluid/operators/crop_op.cc +++ b/paddle/fluid/operators/crop_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/crop_op.h" +#include "paddle/fluid/operators/crop_op.h" #include namespace paddle { diff --git a/paddle/fluid/operators/crop_op.cu b/paddle/fluid/operators/crop_op.cu index bba5db4c6ce..f3610675aae 100644 --- a/paddle/fluid/operators/crop_op.cu +++ b/paddle/fluid/operators/crop_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/crop_op.h" +#include "paddle/fluid/operators/crop_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL(crop, ops::CropKernel); diff --git a/paddle/fluid/operators/crop_op.h b/paddle/fluid/operators/crop_op.h index 69d1a929772..9c7c0446d4c 100644 --- a/paddle/fluid/operators/crop_op.h +++ b/paddle/fluid/operators/crop_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/strided_memcpy.h" namespace paddle { namespace operators { // Internal diff --git a/paddle/fluid/operators/cross_entropy_op.cc b/paddle/fluid/operators/cross_entropy_op.cc index 7abd5b1c61d..5e34b248b6a 100644 --- a/paddle/fluid/operators/cross_entropy_op.cc +++ b/paddle/fluid/operators/cross_entropy_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cross_entropy_op.h" +#include "paddle/fluid/operators/cross_entropy_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cross_entropy_op.cu b/paddle/fluid/operators/cross_entropy_op.cu index 3b04894e6cc..de0976c69fc 100644 --- a/paddle/fluid/operators/cross_entropy_op.cu +++ b/paddle/fluid/operators/cross_entropy_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cross_entropy_op.h" +#include "paddle/fluid/operators/cross_entropy_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cross_entropy_op.h b/paddle/fluid/operators/cross_entropy_op.h index 5623d2ded16..4a5b20ecb70 100644 --- a/paddle/fluid/operators/cross_entropy_op.h +++ b/paddle/fluid/operators/cross_entropy_op.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/cross_entropy.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/cross_entropy.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/ctc_align_op.cc b/paddle/fluid/operators/ctc_align_op.cc index eeecbd32127..3c7db78813e 100644 --- a/paddle/fluid/operators/ctc_align_op.cc +++ b/paddle/fluid/operators/ctc_align_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/ctc_align_op.h" +#include "paddle/fluid/operators/ctc_align_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/ctc_align_op.cu b/paddle/fluid/operators/ctc_align_op.cu index 6406825d4a5..f629e0a9f15 100644 --- a/paddle/fluid/operators/ctc_align_op.cu +++ b/paddle/fluid/operators/ctc_align_op.cu @@ -15,7 +15,7 @@ limitations under the License. */ #include #include #include -#include "paddle/operators/ctc_align_op.h" +#include "paddle/fluid/operators/ctc_align_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/ctc_align_op.h b/paddle/fluid/operators/ctc_align_op.h index 54ad1d6f5cc..1ef034c2f5b 100644 --- a/paddle/fluid/operators/ctc_align_op.h +++ b/paddle/fluid/operators/ctc_align_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cum_op.h b/paddle/fluid/operators/cum_op.h index e3813ac9036..3b224914784 100644 --- a/paddle/fluid/operators/cum_op.h +++ b/paddle/fluid/operators/cum_op.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" -#include "paddle/operators/detail/safe_ref.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/operators/detail/safe_ref.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cumsum_op.cc b/paddle/fluid/operators/cumsum_op.cc index 4933cc923d4..d15d4e3db35 100644 --- a/paddle/fluid/operators/cumsum_op.cc +++ b/paddle/fluid/operators/cumsum_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cum_op.h" +#include "paddle/fluid/operators/cum_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/cumsum_op.cu b/paddle/fluid/operators/cumsum_op.cu index 90661c4269a..e063cc0f65a 100644 --- a/paddle/fluid/operators/cumsum_op.cu +++ b/paddle/fluid/operators/cumsum_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/cum_op.h" +#include "paddle/fluid/operators/cum_op.h" namespace ops = paddle::operators; using CUDA = paddle::platform::CUDADeviceContext; diff --git a/paddle/fluid/operators/decayed_adagrad_op.cc b/paddle/fluid/operators/decayed_adagrad_op.cc index 739a8d881c3..d827155919e 100644 --- a/paddle/fluid/operators/decayed_adagrad_op.cc +++ b/paddle/fluid/operators/decayed_adagrad_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/decayed_adagrad_op.h" +#include "paddle/fluid/operators/decayed_adagrad_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/decayed_adagrad_op.cu b/paddle/fluid/operators/decayed_adagrad_op.cu index 7bc8161f233..215d6dbc7d8 100644 --- a/paddle/fluid/operators/decayed_adagrad_op.cu +++ b/paddle/fluid/operators/decayed_adagrad_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/decayed_adagrad_op.h" +#include "paddle/fluid/operators/decayed_adagrad_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/decayed_adagrad_op.h b/paddle/fluid/operators/decayed_adagrad_op.h index fec9705cfc1..52b67586ea3 100644 --- a/paddle/fluid/operators/decayed_adagrad_op.h +++ b/paddle/fluid/operators/decayed_adagrad_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/detail/grpc_client.cc b/paddle/fluid/operators/detail/grpc_client.cc index 9b5f7afc6a4..0d395d347ba 100644 --- a/paddle/fluid/operators/detail/grpc_client.cc +++ b/paddle/fluid/operators/detail/grpc_client.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "grpc_client.h" -#include "paddle/framework/threadpool.h" +#include "paddle/fluid/framework/threadpool.h" namespace paddle { namespace operators { namespace detail { diff --git a/paddle/fluid/operators/detail/grpc_client.h b/paddle/fluid/operators/detail/grpc_client.h index f9499f6dc70..314fe8168f0 100644 --- a/paddle/fluid/operators/detail/grpc_client.h +++ b/paddle/fluid/operators/detail/grpc_client.h @@ -25,12 +25,12 @@ limitations under the License. */ #include #include -#include "paddle/framework/data_type.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/scope.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/operators/detail/sendrecvop_utils.h" -#include "paddle/operators/detail/simple_block_queue.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/scope.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/operators/detail/sendrecvop_utils.h" +#include "paddle/fluid/operators/detail/simple_block_queue.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/detail/grpc_server.cc b/paddle/fluid/operators/detail/grpc_server.cc index 4f94e1315fb..96f4ea797b1 100644 --- a/paddle/fluid/operators/detail/grpc_server.cc +++ b/paddle/fluid/operators/detail/grpc_server.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/detail/grpc_server.h" +#include "paddle/fluid/operators/detail/grpc_server.h" using grpc::ServerAsyncResponseWriter; diff --git a/paddle/fluid/operators/detail/grpc_server.h b/paddle/fluid/operators/detail/grpc_server.h index 3f8b9d93176..1382d173183 100644 --- a/paddle/fluid/operators/detail/grpc_server.h +++ b/paddle/fluid/operators/detail/grpc_server.h @@ -14,19 +14,19 @@ limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/scope.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/framework/var_type.h" -#include "paddle/operators/detail/simple_block_queue.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/scope.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/framework/var_type.h" +#include "paddle/fluid/operators/detail/simple_block_queue.h" -#include "paddle/operators/detail/send_recv.grpc.pb.h" -#include "paddle/operators/detail/send_recv.pb.h" +#include "paddle/fluid/operators/detail/send_recv.grpc.pb.h" +#include "paddle/fluid/operators/detail/send_recv.pb.h" #include #include #include -#include "paddle/operators/detail/sendrecvop_utils.h" +#include "paddle/fluid/operators/detail/sendrecvop_utils.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/detail/sendrecvop_utils.cc b/paddle/fluid/operators/detail/sendrecvop_utils.cc index 7635b9e8dbd..ba3ae6add60 100644 --- a/paddle/fluid/operators/detail/sendrecvop_utils.cc +++ b/paddle/fluid/operators/detail/sendrecvop_utils.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/detail/sendrecvop_utils.h" +#include "paddle/fluid/operators/detail/sendrecvop_utils.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/detail/sendrecvop_utils.h b/paddle/fluid/operators/detail/sendrecvop_utils.h index 8e66f7299c7..fed887c0279 100644 --- a/paddle/fluid/operators/detail/sendrecvop_utils.h +++ b/paddle/fluid/operators/detail/sendrecvop_utils.h @@ -17,14 +17,14 @@ limitations under the License. */ #include #include -#include "paddle/framework/data_type.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/scope.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/framework/var_type.h" - -#include "paddle/operators/detail/send_recv.grpc.pb.h" -#include "paddle/operators/detail/send_recv.pb.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/scope.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/framework/var_type.h" + +#include "paddle/fluid/operators/detail/send_recv.grpc.pb.h" +#include "paddle/fluid/operators/detail/send_recv.pb.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/detail/strided_memcpy.h b/paddle/fluid/operators/detail/strided_memcpy.h index 9ed524d4dcf..d7a7eed50b9 100644 --- a/paddle/fluid/operators/detail/strided_memcpy.h +++ b/paddle/fluid/operators/detail/strided_memcpy.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/ddim.h" -#include "paddle/memory/memcpy.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/detection_output_op.cc b/paddle/fluid/operators/detection_output_op.cc index ea44cd32678..6dee5222959 100644 --- a/paddle/fluid/operators/detection_output_op.cc +++ b/paddle/fluid/operators/detection_output_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/detection_output_op.h" +#include "paddle/fluid/operators/detection_output_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/detection_output_op.cu.cc b/paddle/fluid/operators/detection_output_op.cu.cc index 4a6560e0492..309e03a25be 100644 --- a/paddle/fluid/operators/detection_output_op.cu.cc +++ b/paddle/fluid/operators/detection_output_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/detection_output_op.h" +#include "paddle/fluid/operators/detection_output_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/detection_output_op.h b/paddle/fluid/operators/detection_output_op.h index 86285b748a7..05e5b72bd35 100644 --- a/paddle/fluid/operators/detection_output_op.h +++ b/paddle/fluid/operators/detection_output_op.h @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/framework/tensor.h" -#include "paddle/operators/math/detection_util.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/softmax.h" -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/operators/math/detection_util.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/softmax.h" +#include "paddle/fluid/operators/strided_memcpy.h" namespace paddle { namespace operators { template diff --git a/paddle/fluid/operators/dropout_op.cc b/paddle/fluid/operators/dropout_op.cc index 5274aa204e6..e1dc900512c 100644 --- a/paddle/fluid/operators/dropout_op.cc +++ b/paddle/fluid/operators/dropout_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/dropout_op.h" +#include "paddle/fluid/operators/dropout_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/dropout_op.cu b/paddle/fluid/operators/dropout_op.cu index 84d78445a4f..4ae9f4ce54d 100644 --- a/paddle/fluid/operators/dropout_op.cu +++ b/paddle/fluid/operators/dropout_op.cu @@ -17,7 +17,7 @@ limitations under the License. */ #include #include #include -#include "paddle/operators/dropout_op.h" +#include "paddle/fluid/operators/dropout_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/dropout_op.h b/paddle/fluid/operators/dropout_op.h index 46e5dbc64ff..9dd1f33669c 100644 --- a/paddle/fluid/operators/dropout_op.h +++ b/paddle/fluid/operators/dropout_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/edit_distance_op.cc b/paddle/fluid/operators/edit_distance_op.cc index 7e7dfc79eba..ae82408da71 100644 --- a/paddle/fluid/operators/edit_distance_op.cc +++ b/paddle/fluid/operators/edit_distance_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/edit_distance_op.h" +#include "paddle/fluid/operators/edit_distance_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/edit_distance_op.cu b/paddle/fluid/operators/edit_distance_op.cu index c3e116af086..bdfead75e71 100644 --- a/paddle/fluid/operators/edit_distance_op.cu +++ b/paddle/fluid/operators/edit_distance_op.cu @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/cuda_helper.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/cuda_helper.h" +#include "paddle/fluid/platform/gpu_info.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/edit_distance_op.h b/paddle/fluid/operators/edit_distance_op.h index 974299e604d..205e16e6bfe 100644 --- a/paddle/fluid/operators/edit_distance_op.h +++ b/paddle/fluid/operators/edit_distance_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_add_op.cc b/paddle/fluid/operators/elementwise_add_op.cc index 37951fa7587..5b9947b8c93 100644 --- a/paddle/fluid/operators/elementwise_add_op.cc +++ b/paddle/fluid/operators/elementwise_add_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_add_op.h" -#include "paddle/operators/elementwise_op.h" +#include "paddle/fluid/operators/elementwise_add_op.h" +#include "paddle/fluid/operators/elementwise_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_add_op.cu b/paddle/fluid/operators/elementwise_add_op.cu index 641cea323ac..2ac3a998ec4 100644 --- a/paddle/fluid/operators/elementwise_add_op.cu +++ b/paddle/fluid/operators/elementwise_add_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/elementwise_add_op.h" +#include "paddle/fluid/operators/elementwise_add_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/elementwise_add_op.h b/paddle/fluid/operators/elementwise_add_op.h index c24f97a8509..248e3b9d617 100644 --- a/paddle/fluid/operators/elementwise_add_op.h +++ b/paddle/fluid/operators/elementwise_add_op.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_div_op.cc b/paddle/fluid/operators/elementwise_div_op.cc index 6ebd58b1b3d..818ae82f44c 100644 --- a/paddle/fluid/operators/elementwise_div_op.cc +++ b/paddle/fluid/operators/elementwise_div_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_div_op.h" -#include "paddle/operators/elementwise_op.h" +#include "paddle/fluid/operators/elementwise_div_op.h" +#include "paddle/fluid/operators/elementwise_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_div_op.cu b/paddle/fluid/operators/elementwise_div_op.cu index a0372123d6f..d1bb7a474c0 100644 --- a/paddle/fluid/operators/elementwise_div_op.cu +++ b/paddle/fluid/operators/elementwise_div_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/elementwise_div_op.h" +#include "paddle/fluid/operators/elementwise_div_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/elementwise_div_op.h b/paddle/fluid/operators/elementwise_div_op.h index dc863cc598e..8e0726d9465 100644 --- a/paddle/fluid/operators/elementwise_div_op.h +++ b/paddle/fluid/operators/elementwise_div_op.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_max_op.cc b/paddle/fluid/operators/elementwise_max_op.cc index 53c27ae5be4..1331bcadc8c 100644 --- a/paddle/fluid/operators/elementwise_max_op.cc +++ b/paddle/fluid/operators/elementwise_max_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_max_op.h" -#include "paddle/operators/elementwise_op.h" +#include "paddle/fluid/operators/elementwise_max_op.h" +#include "paddle/fluid/operators/elementwise_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_max_op.cu b/paddle/fluid/operators/elementwise_max_op.cu index 5ff4af17477..7f0259ad002 100644 --- a/paddle/fluid/operators/elementwise_max_op.cu +++ b/paddle/fluid/operators/elementwise_max_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/elementwise_max_op.h" +#include "paddle/fluid/operators/elementwise_max_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/elementwise_max_op.h b/paddle/fluid/operators/elementwise_max_op.h index 67efe4e1511..e1db9bcc011 100644 --- a/paddle/fluid/operators/elementwise_max_op.h +++ b/paddle/fluid/operators/elementwise_max_op.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_min_op.cc b/paddle/fluid/operators/elementwise_min_op.cc index 99482e1bf60..1d69099c8e6 100644 --- a/paddle/fluid/operators/elementwise_min_op.cc +++ b/paddle/fluid/operators/elementwise_min_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_min_op.h" -#include "paddle/operators/elementwise_op.h" +#include "paddle/fluid/operators/elementwise_min_op.h" +#include "paddle/fluid/operators/elementwise_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_min_op.cu b/paddle/fluid/operators/elementwise_min_op.cu index 3547e6ccb77..ed532047350 100644 --- a/paddle/fluid/operators/elementwise_min_op.cu +++ b/paddle/fluid/operators/elementwise_min_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/elementwise_min_op.h" +#include "paddle/fluid/operators/elementwise_min_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/elementwise_min_op.h b/paddle/fluid/operators/elementwise_min_op.h index cf11759404d..bfe213dd431 100644 --- a/paddle/fluid/operators/elementwise_min_op.h +++ b/paddle/fluid/operators/elementwise_min_op.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_mul_op.cc b/paddle/fluid/operators/elementwise_mul_op.cc index 450dd05c796..0cb96f21d1b 100644 --- a/paddle/fluid/operators/elementwise_mul_op.cc +++ b/paddle/fluid/operators/elementwise_mul_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_mul_op.h" -#include "paddle/operators/elementwise_op.h" +#include "paddle/fluid/operators/elementwise_mul_op.h" +#include "paddle/fluid/operators/elementwise_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_mul_op.cu b/paddle/fluid/operators/elementwise_mul_op.cu index f73e8afda96..d72b6250eed 100644 --- a/paddle/fluid/operators/elementwise_mul_op.cu +++ b/paddle/fluid/operators/elementwise_mul_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/elementwise_mul_op.h" +#include "paddle/fluid/operators/elementwise_mul_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/elementwise_mul_op.h b/paddle/fluid/operators/elementwise_mul_op.h index 773125f5ca5..dc292eb1e72 100644 --- a/paddle/fluid/operators/elementwise_mul_op.h +++ b/paddle/fluid/operators/elementwise_mul_op.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_op.h b/paddle/fluid/operators/elementwise_op.h index 1a0131d8b94..38f83d7ad36 100644 --- a/paddle/fluid/operators/elementwise_op.h +++ b/paddle/fluid/operators/elementwise_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_op_function.h b/paddle/fluid/operators/elementwise_op_function.h index 74abf7c4a58..c1269382a44 100644 --- a/paddle/fluid/operators/elementwise_op_function.h +++ b/paddle/fluid/operators/elementwise_op_function.h @@ -13,16 +13,16 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/platform/transform.h" #ifdef __NVCC__ #include #endif -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_pow_op.cc b/paddle/fluid/operators/elementwise_pow_op.cc index 5293cc7dd34..911b5dbd250 100644 --- a/paddle/fluid/operators/elementwise_pow_op.cc +++ b/paddle/fluid/operators/elementwise_pow_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_pow_op.h" -#include "paddle/operators/elementwise_op.h" +#include "paddle/fluid/operators/elementwise_pow_op.h" +#include "paddle/fluid/operators/elementwise_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_pow_op.cu b/paddle/fluid/operators/elementwise_pow_op.cu index 643c978e635..2996600738f 100644 --- a/paddle/fluid/operators/elementwise_pow_op.cu +++ b/paddle/fluid/operators/elementwise_pow_op.cu @@ -10,7 +10,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/elementwise_pow_op.h" +#include "paddle/fluid/operators/elementwise_pow_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/elementwise_pow_op.h b/paddle/fluid/operators/elementwise_pow_op.h index 0c5dd031ec4..b793c1eae0e 100644 --- a/paddle/fluid/operators/elementwise_pow_op.h +++ b/paddle/fluid/operators/elementwise_pow_op.h @@ -15,7 +15,7 @@ limitations under the License. */ #pragma once #include -#include "paddle/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_sub_op.cc b/paddle/fluid/operators/elementwise_sub_op.cc index d3c51f0a697..46ce01c7cf5 100644 --- a/paddle/fluid/operators/elementwise_sub_op.cc +++ b/paddle/fluid/operators/elementwise_sub_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/elementwise_sub_op.h" -#include "paddle/operators/elementwise_op.h" +#include "paddle/fluid/operators/elementwise_sub_op.h" +#include "paddle/fluid/operators/elementwise_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/elementwise_sub_op.cu b/paddle/fluid/operators/elementwise_sub_op.cu index 7a2516ef6a6..eb09d6c5edc 100644 --- a/paddle/fluid/operators/elementwise_sub_op.cu +++ b/paddle/fluid/operators/elementwise_sub_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/elementwise_sub_op.h" +#include "paddle/fluid/operators/elementwise_sub_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/elementwise_sub_op.h b/paddle/fluid/operators/elementwise_sub_op.h index 6a88c5f6b4c..af2d497b9ae 100644 --- a/paddle/fluid/operators/elementwise_sub_op.h +++ b/paddle/fluid/operators/elementwise_sub_op.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/expand_op.cc b/paddle/fluid/operators/expand_op.cc index 043c93654d3..ccb9a94856f 100644 --- a/paddle/fluid/operators/expand_op.cc +++ b/paddle/fluid/operators/expand_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/expand_op.h" +#include "paddle/fluid/operators/expand_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/expand_op.cu b/paddle/fluid/operators/expand_op.cu index 84e8fa567b8..8a9f39708be 100644 --- a/paddle/fluid/operators/expand_op.cu +++ b/paddle/fluid/operators/expand_op.cu @@ -14,7 +14,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/expand_op.h" +#include "paddle/fluid/operators/expand_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/expand_op.h b/paddle/fluid/operators/expand_op.h index a4994cf3a5b..8df1cd34d7d 100644 --- a/paddle/fluid/operators/expand_op.h +++ b/paddle/fluid/operators/expand_op.h @@ -21,9 +21,9 @@ limitations under the License. */ #include #include #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" #define MAX_RANK_SUPPORTED 6 diff --git a/paddle/fluid/operators/feed_op.cc b/paddle/fluid/operators/feed_op.cc index 789d01e0022..0b3f5f0d1d0 100644 --- a/paddle/fluid/operators/feed_op.cc +++ b/paddle/fluid/operators/feed_op.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/feed_fetch_type.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/feed_fetch_type.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/fetch_op.cc b/paddle/fluid/operators/fetch_op.cc index 7205ee2a879..54e5892016c 100644 --- a/paddle/fluid/operators/fetch_op.cc +++ b/paddle/fluid/operators/fetch_op.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/feed_fetch_type.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/feed_fetch_type.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/fill_constant_batch_size_like_op.cc b/paddle/fluid/operators/fill_constant_batch_size_like_op.cc index c74a5b6ced3..e6992ba371c 100644 --- a/paddle/fluid/operators/fill_constant_batch_size_like_op.cc +++ b/paddle/fluid/operators/fill_constant_batch_size_like_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/fill_constant_batch_size_like_op.h" +#include "paddle/fluid/operators/fill_constant_batch_size_like_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/fill_constant_batch_size_like_op.cu.cc b/paddle/fluid/operators/fill_constant_batch_size_like_op.cu.cc index 608f4b91623..b4f4d2a5030 100644 --- a/paddle/fluid/operators/fill_constant_batch_size_like_op.cu.cc +++ b/paddle/fluid/operators/fill_constant_batch_size_like_op.cu.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/fill_constant_batch_size_like_op.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/operators/fill_constant_batch_size_like_op.h" +#include "paddle/fluid/framework/op_registry.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/fill_constant_batch_size_like_op.h b/paddle/fluid/operators/fill_constant_batch_size_like_op.h index 66da9d0307e..da4a20d99a1 100644 --- a/paddle/fluid/operators/fill_constant_batch_size_like_op.h +++ b/paddle/fluid/operators/fill_constant_batch_size_like_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/fill_constant_op.cc b/paddle/fluid/operators/fill_constant_op.cc index dcd43a30c86..d4bf6406e57 100644 --- a/paddle/fluid/operators/fill_constant_op.cc +++ b/paddle/fluid/operators/fill_constant_op.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/data_type.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/fill_op.cc b/paddle/fluid/operators/fill_op.cc index 4f5a2ed1695..8e318f37cf0 100644 --- a/paddle/fluid/operators/fill_op.cc +++ b/paddle/fluid/operators/fill_op.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/data_type.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/detail/safe_ref.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/detail/safe_ref.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/fill_zeros_like_op.cc b/paddle/fluid/operators/fill_zeros_like_op.cc index b4ae1de8760..958bfb1557d 100644 --- a/paddle/fluid/operators/fill_zeros_like_op.cc +++ b/paddle/fluid/operators/fill_zeros_like_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/fill_zeros_like_op.h" +#include "paddle/fluid/operators/fill_zeros_like_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/fill_zeros_like_op.cu.cc b/paddle/fluid/operators/fill_zeros_like_op.cu.cc index b7048e8f585..07078573d8a 100644 --- a/paddle/fluid/operators/fill_zeros_like_op.cu.cc +++ b/paddle/fluid/operators/fill_zeros_like_op.cu.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/fill_zeros_like_op.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/operators/fill_zeros_like_op.h" +#include "paddle/fluid/framework/op_registry.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/fill_zeros_like_op.h b/paddle/fluid/operators/fill_zeros_like_op.h index 351ecf8b2f1..141c3809e9a 100644 --- a/paddle/fluid/operators/fill_zeros_like_op.h +++ b/paddle/fluid/operators/fill_zeros_like_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/ftrl_op.cc b/paddle/fluid/operators/ftrl_op.cc index d00700823d4..e72a173751e 100644 --- a/paddle/fluid/operators/ftrl_op.cc +++ b/paddle/fluid/operators/ftrl_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/ftrl_op.h" +#include "paddle/fluid/operators/ftrl_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/ftrl_op.cu b/paddle/fluid/operators/ftrl_op.cu index abbbe7adbe6..dbdfcb927e0 100644 --- a/paddle/fluid/operators/ftrl_op.cu +++ b/paddle/fluid/operators/ftrl_op.cu @@ -12,7 +12,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/ftrl_op.h" +#include "paddle/fluid/operators/ftrl_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/ftrl_op.h b/paddle/fluid/operators/ftrl_op.h index 4eea04cd8d6..0a9405fcef1 100644 --- a/paddle/fluid/operators/ftrl_op.h +++ b/paddle/fluid/operators/ftrl_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gather.cu.h b/paddle/fluid/operators/gather.cu.h index 9840c066f05..af5898e29ec 100644 --- a/paddle/fluid/operators/gather.cu.h +++ b/paddle/fluid/operators/gather.cu.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gather.h b/paddle/fluid/operators/gather.h index 052db49cb3c..287732eeb6e 100644 --- a/paddle/fluid/operators/gather.h +++ b/paddle/fluid/operators/gather.h @@ -16,10 +16,10 @@ limitations under the License. */ #include #include -#include "paddle/framework/ddim.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gather_op.cc b/paddle/fluid/operators/gather_op.cc index 597fdad0794..dceeb71ee35 100644 --- a/paddle/fluid/operators/gather_op.cc +++ b/paddle/fluid/operators/gather_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/gather_op.h" -#include "paddle/framework/ddim.h" +#include "paddle/fluid/operators/gather_op.h" +#include "paddle/fluid/framework/ddim.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gather_op.cu b/paddle/fluid/operators/gather_op.cu index eec2415e1de..484f4232624 100644 --- a/paddle/fluid/operators/gather_op.cu +++ b/paddle/fluid/operators/gather_op.cu @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "gather.cu.h" -#include "paddle/framework/eigen.h" -#include "paddle/operators/gather_op.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/operators/gather_op.h" #include "scatter.cu.h" namespace paddle { diff --git a/paddle/fluid/operators/gather_op.h b/paddle/fluid/operators/gather_op.h index 1a1ba0c41ae..7ba4a31c81b 100644 --- a/paddle/fluid/operators/gather_op.h +++ b/paddle/fluid/operators/gather_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include "gather.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" #include "scatter.h" namespace paddle { diff --git a/paddle/fluid/operators/gather_test.cc b/paddle/fluid/operators/gather_test.cc index cbd86b87961..4d86cf5ce33 100644 --- a/paddle/fluid/operators/gather_test.cc +++ b/paddle/fluid/operators/gather_test.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/gather.h" -#include "paddle/framework/ddim.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/operators/gather.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/place.h" #include #include diff --git a/paddle/fluid/operators/gaussian_random_op.cc b/paddle/fluid/operators/gaussian_random_op.cc index 2dca05760ec..b090f875976 100644 --- a/paddle/fluid/operators/gaussian_random_op.cc +++ b/paddle/fluid/operators/gaussian_random_op.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gaussian_random_op.cu b/paddle/fluid/operators/gaussian_random_op.cu index 8a70db17e17..70d655d4bb2 100644 --- a/paddle/fluid/operators/gaussian_random_op.cu +++ b/paddle/fluid/operators/gaussian_random_op.cu @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include #include -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/get_places_op.cc b/paddle/fluid/operators/get_places_op.cc index 24fafb23074..ba908e472bb 100644 --- a/paddle/fluid/operators/get_places_op.cc +++ b/paddle/fluid/operators/get_places_op.cc @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/detail/safe_ref.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/detail/safe_ref.h" +#include "paddle/fluid/platform/place.h" #ifdef PADDLE_WITH_CUDA -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/platform/gpu_info.h" #endif namespace paddle { diff --git a/paddle/fluid/operators/gru_op.cc b/paddle/fluid/operators/gru_op.cc index fb901b63949..1436e55b0e1 100644 --- a/paddle/fluid/operators/gru_op.cc +++ b/paddle/fluid/operators/gru_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/gru_op.h" +#include "paddle/fluid/operators/gru_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gru_op.cu.cc b/paddle/fluid/operators/gru_op.cu.cc index 9cb0cc42d55..e908d01d292 100644 --- a/paddle/fluid/operators/gru_op.cu.cc +++ b/paddle/fluid/operators/gru_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/gru_op.h" +#include "paddle/fluid/operators/gru_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/gru_op.h b/paddle/fluid/operators/gru_op.h index a08bd4233b0..37f3ae1a837 100644 --- a/paddle/fluid/operators/gru_op.h +++ b/paddle/fluid/operators/gru_op.h @@ -14,13 +14,13 @@ limitations under the License. */ #pragma once -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/operators/math/gru_compute.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/sequence2batch.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/gru_compute.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence2batch.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gru_unit_op.cc b/paddle/fluid/operators/gru_unit_op.cc index c354293be77..21ad3aeb492 100644 --- a/paddle/fluid/operators/gru_unit_op.cc +++ b/paddle/fluid/operators/gru_unit_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/gru_unit_op.h" +#include "paddle/fluid/operators/gru_unit_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/gru_unit_op.cu b/paddle/fluid/operators/gru_unit_op.cu index 95c8c23dada..88b707fd131 100644 --- a/paddle/fluid/operators/gru_unit_op.cu +++ b/paddle/fluid/operators/gru_unit_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/gru_unit_op.h" +#include "paddle/fluid/operators/gru_unit_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/gru_unit_op.h b/paddle/fluid/operators/gru_unit_op.h index a77be46718b..c4031a5a575 100644 --- a/paddle/fluid/operators/gru_unit_op.h +++ b/paddle/fluid/operators/gru_unit_op.h @@ -14,11 +14,11 @@ limitations under the License. */ #pragma once -#include "paddle/operators/activation_op.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/activation_op.h" +#include "paddle/fluid/operators/math/math_function.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/hinge_loss_op.cc b/paddle/fluid/operators/hinge_loss_op.cc index 19d2e9dc56f..f644c22c9f1 100644 --- a/paddle/fluid/operators/hinge_loss_op.cc +++ b/paddle/fluid/operators/hinge_loss_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/hinge_loss_op.h" +#include "paddle/fluid/operators/hinge_loss_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/hinge_loss_op.cu b/paddle/fluid/operators/hinge_loss_op.cu index b9cfbc50c49..cb53a9b7f4a 100644 --- a/paddle/fluid/operators/hinge_loss_op.cu +++ b/paddle/fluid/operators/hinge_loss_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/hinge_loss_op.h" +#include "paddle/fluid/operators/hinge_loss_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/hinge_loss_op.h b/paddle/fluid/operators/hinge_loss_op.h index 91369cfb8a5..1e924d236ea 100644 --- a/paddle/fluid/operators/hinge_loss_op.h +++ b/paddle/fluid/operators/hinge_loss_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/huber_loss_op.cc b/paddle/fluid/operators/huber_loss_op.cc index 5c92f2c7b2d..dc1f609dcfa 100644 --- a/paddle/fluid/operators/huber_loss_op.cc +++ b/paddle/fluid/operators/huber_loss_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/huber_loss_op.h" +#include "paddle/fluid/operators/huber_loss_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/huber_loss_op.cu b/paddle/fluid/operators/huber_loss_op.cu index ccc83a16ba2..ef5120c69d4 100644 --- a/paddle/fluid/operators/huber_loss_op.cu +++ b/paddle/fluid/operators/huber_loss_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/huber_loss_op.h" +#include "paddle/fluid/operators/huber_loss_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/huber_loss_op.h b/paddle/fluid/operators/huber_loss_op.h index 4dd20e8b080..caca89fcf63 100644 --- a/paddle/fluid/operators/huber_loss_op.h +++ b/paddle/fluid/operators/huber_loss_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/im2sequence_op.cc b/paddle/fluid/operators/im2sequence_op.cc index 31baaedf691..936e5fe49ed 100644 --- a/paddle/fluid/operators/im2sequence_op.cc +++ b/paddle/fluid/operators/im2sequence_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/im2sequence_op.h" +#include "paddle/fluid/operators/im2sequence_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/im2sequence_op.cu b/paddle/fluid/operators/im2sequence_op.cu index 9db7529112f..1e7bf463122 100644 --- a/paddle/fluid/operators/im2sequence_op.cu +++ b/paddle/fluid/operators/im2sequence_op.cu @@ -13,7 +13,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/im2sequence_op.h" +#include "paddle/fluid/operators/im2sequence_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/im2sequence_op.h b/paddle/fluid/operators/im2sequence_op.h index f33aec71a92..59456f0ea29 100644 --- a/paddle/fluid/operators/im2sequence_op.h +++ b/paddle/fluid/operators/im2sequence_op.h @@ -14,11 +14,11 @@ #pragma once -#include "paddle/framework/data_layout.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/im2col.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/data_layout.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/im2col.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/increment_op.cc b/paddle/fluid/operators/increment_op.cc index e0b80cc4e74..3d488067b25 100644 --- a/paddle/fluid/operators/increment_op.cc +++ b/paddle/fluid/operators/increment_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/iou_similarity_op.cc b/paddle/fluid/operators/iou_similarity_op.cc index c520b28b83e..c2e452cdfaa 100755 --- a/paddle/fluid/operators/iou_similarity_op.cc +++ b/paddle/fluid/operators/iou_similarity_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/iou_similarity_op.h" +#include "paddle/fluid/operators/iou_similarity_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/iou_similarity_op.cu b/paddle/fluid/operators/iou_similarity_op.cu index fa505262461..f8df1f4aa4c 100755 --- a/paddle/fluid/operators/iou_similarity_op.cu +++ b/paddle/fluid/operators/iou_similarity_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/iou_similarity_op.h" +#include "paddle/fluid/operators/iou_similarity_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/iou_similarity_op.h b/paddle/fluid/operators/iou_similarity_op.h index e36177069d7..2fb1b5f7070 100644 --- a/paddle/fluid/operators/iou_similarity_op.h +++ b/paddle/fluid/operators/iou_similarity_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/platform/for_range.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/for_range.h" template inline HOSTDEVICE T IOUSimilarity(T xmin1, T ymin1, T xmax1, T ymax1, T xmin2, diff --git a/paddle/fluid/operators/is_empty_op.cc b/paddle/fluid/operators/is_empty_op.cc index 492ae48845a..ea424018d66 100644 --- a/paddle/fluid/operators/is_empty_op.cc +++ b/paddle/fluid/operators/is_empty_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/l1_norm_op.cc b/paddle/fluid/operators/l1_norm_op.cc index 1a5d6e19263..974ee404f83 100644 --- a/paddle/fluid/operators/l1_norm_op.cc +++ b/paddle/fluid/operators/l1_norm_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/l1_norm_op.h" +#include "paddle/fluid/operators/l1_norm_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/l1_norm_op.cu b/paddle/fluid/operators/l1_norm_op.cu index 7ecc774670a..5e9e864a346 100644 --- a/paddle/fluid/operators/l1_norm_op.cu +++ b/paddle/fluid/operators/l1_norm_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/l1_norm_op.h" +#include "paddle/fluid/operators/l1_norm_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/l1_norm_op.h b/paddle/fluid/operators/l1_norm_op.h index 086d42705dc..7ddf2ac6a90 100644 --- a/paddle/fluid/operators/l1_norm_op.h +++ b/paddle/fluid/operators/l1_norm_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/label_smooth_op.cc b/paddle/fluid/operators/label_smooth_op.cc index c89082f44b3..c018965beef 100644 --- a/paddle/fluid/operators/label_smooth_op.cc +++ b/paddle/fluid/operators/label_smooth_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/label_smooth_op.h" +#include "paddle/fluid/operators/label_smooth_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/label_smooth_op.cu b/paddle/fluid/operators/label_smooth_op.cu index 5a0cec12bc5..4a40a4e9ec8 100644 --- a/paddle/fluid/operators/label_smooth_op.cu +++ b/paddle/fluid/operators/label_smooth_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/label_smooth_op.h" +#include "paddle/fluid/operators/label_smooth_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/label_smooth_op.h b/paddle/fluid/operators/label_smooth_op.h index 87bc9f793e3..15752377f66 100644 --- a/paddle/fluid/operators/label_smooth_op.h +++ b/paddle/fluid/operators/label_smooth_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/layer_norm_op.cc b/paddle/fluid/operators/layer_norm_op.cc index d9b774272cb..60e37ed01b3 100644 --- a/paddle/fluid/operators/layer_norm_op.cc +++ b/paddle/fluid/operators/layer_norm_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/layer_norm_op.h" +#include "paddle/fluid/operators/layer_norm_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/layer_norm_op.cu b/paddle/fluid/operators/layer_norm_op.cu index 77d13b216f0..aa54fd54155 100644 --- a/paddle/fluid/operators/layer_norm_op.cu +++ b/paddle/fluid/operators/layer_norm_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/layer_norm_op.h" +#include "paddle/fluid/operators/layer_norm_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/layer_norm_op.h b/paddle/fluid/operators/layer_norm_op.h index 3c436b89263..60c0b07add1 100644 --- a/paddle/fluid/operators/layer_norm_op.h +++ b/paddle/fluid/operators/layer_norm_op.h @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" -#include "paddle/operators/elementwise_op_function.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/elementwise_op_function.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/linear_chain_crf_op.cc b/paddle/fluid/operators/linear_chain_crf_op.cc index e24bf622b7f..3e1dfa49487 100644 --- a/paddle/fluid/operators/linear_chain_crf_op.cc +++ b/paddle/fluid/operators/linear_chain_crf_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/linear_chain_crf_op.h" +#include "paddle/fluid/operators/linear_chain_crf_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/linear_chain_crf_op.cu b/paddle/fluid/operators/linear_chain_crf_op.cu index da612510b4d..6e04e76eebc 100644 --- a/paddle/fluid/operators/linear_chain_crf_op.cu +++ b/paddle/fluid/operators/linear_chain_crf_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/linear_chain_crf_op.h" +#include "paddle/fluid/operators/linear_chain_crf_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/linear_chain_crf_op.h b/paddle/fluid/operators/linear_chain_crf_op.h index afc197a1c38..15b64c09bf3 100644 --- a/paddle/fluid/operators/linear_chain_crf_op.h +++ b/paddle/fluid/operators/linear_chain_crf_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index 099f6b23736..a72708d9baa 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -19,14 +19,14 @@ limitations under the License. */ #include -#include "paddle/framework/executor.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/proto_desc.h" -#include "paddle/operators/detail/grpc_server.h" -#include "paddle/operators/detail/sendrecvop_utils.h" -#include "paddle/operators/detail/simple_block_queue.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/proto_desc.h" +#include "paddle/fluid/operators/detail/grpc_server.h" +#include "paddle/fluid/operators/detail/sendrecvop_utils.h" +#include "paddle/fluid/operators/detail/simple_block_queue.h" #include "paddle/string/printf.h" namespace paddle { diff --git a/paddle/fluid/operators/load_combine_op.cc b/paddle/fluid/operators/load_combine_op.cc index f4be793d7bf..1948063d886 100644 --- a/paddle/fluid/operators/load_combine_op.cc +++ b/paddle/fluid/operators/load_combine_op.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/op_registry.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/load_op.cc b/paddle/fluid/operators/load_op.cc index f886b423ac7..c9bf5d72b23 100644 --- a/paddle/fluid/operators/load_op.cc +++ b/paddle/fluid/operators/load_op.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/op_registry.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lod_array_length_op.cc b/paddle/fluid/operators/lod_array_length_op.cc index d2c52745cfd..f11f5a89f5a 100644 --- a/paddle/fluid/operators/lod_array_length_op.cc +++ b/paddle/fluid/operators/lod_array_length_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lod_rank_table_op.cc b/paddle/fluid/operators/lod_rank_table_op.cc index 692b9bf3710..0b9426a9f8f 100644 --- a/paddle/fluid/operators/lod_rank_table_op.cc +++ b/paddle/fluid/operators/lod_rank_table_op.cc @@ -11,8 +11,8 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lod_reset_op.cc b/paddle/fluid/operators/lod_reset_op.cc index 3d7b15edcfe..55ae71c1815 100644 --- a/paddle/fluid/operators/lod_reset_op.cc +++ b/paddle/fluid/operators/lod_reset_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lod_reset_op.h" +#include "paddle/fluid/operators/lod_reset_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lod_reset_op.cu b/paddle/fluid/operators/lod_reset_op.cu index 910866ea633..8bfc8bd3bf0 100644 --- a/paddle/fluid/operators/lod_reset_op.cu +++ b/paddle/fluid/operators/lod_reset_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lod_reset_op.h" +#include "paddle/fluid/operators/lod_reset_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/lod_reset_op.h b/paddle/fluid/operators/lod_reset_op.h index c1bbba7a83a..a10efee0bdd 100644 --- a/paddle/fluid/operators/lod_reset_op.h +++ b/paddle/fluid/operators/lod_reset_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lod_tensor_to_array_op.cc b/paddle/fluid/operators/lod_tensor_to_array_op.cc index 685a807a8ac..edc32bcec14 100644 --- a/paddle/fluid/operators/lod_tensor_to_array_op.cc +++ b/paddle/fluid/operators/lod_tensor_to_array_op.cc @@ -11,11 +11,11 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/detail/safe_ref.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/detail/safe_ref.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/log_loss_op.cc b/paddle/fluid/operators/log_loss_op.cc index f714945354c..6c5cd295681 100644 --- a/paddle/fluid/operators/log_loss_op.cc +++ b/paddle/fluid/operators/log_loss_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/log_loss_op.h" +#include "paddle/fluid/operators/log_loss_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/log_loss_op.cu b/paddle/fluid/operators/log_loss_op.cu index be283e47005..c164a6d0405 100644 --- a/paddle/fluid/operators/log_loss_op.cu +++ b/paddle/fluid/operators/log_loss_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/log_loss_op.h" +#include "paddle/fluid/operators/log_loss_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/log_loss_op.h b/paddle/fluid/operators/log_loss_op.h index 743eddb7400..67fac7cfe55 100644 --- a/paddle/fluid/operators/log_loss_op.h +++ b/paddle/fluid/operators/log_loss_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/logical_op.cc b/paddle/fluid/operators/logical_op.cc index fedd325cf4f..ff49895df19 100644 --- a/paddle/fluid/operators/logical_op.cc +++ b/paddle/fluid/operators/logical_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/logical_op.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/operators/logical_op.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/logical_op.cu b/paddle/fluid/operators/logical_op.cu index 87f2287b8f1..2b174440612 100644 --- a/paddle/fluid/operators/logical_op.cu +++ b/paddle/fluid/operators/logical_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/logical_op.h" +#include "paddle/fluid/operators/logical_op.h" REGISTER_BINARY_LOGICAL_KERNEL(logical_and, CUDA, paddle::operators::LogicalAndFunctor); diff --git a/paddle/fluid/operators/logical_op.h b/paddle/fluid/operators/logical_op.h index 41385768560..f6d5866c2c8 100644 --- a/paddle/fluid/operators/logical_op.h +++ b/paddle/fluid/operators/logical_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include #include -#include "paddle/framework/op_registry.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lookup_table_op.cc b/paddle/fluid/operators/lookup_table_op.cc index 2405852f53d..2c555f1a3fa 100644 --- a/paddle/fluid/operators/lookup_table_op.cc +++ b/paddle/fluid/operators/lookup_table_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lookup_table_op.h" -#include "paddle/framework/var_type_inference.h" +#include "paddle/fluid/operators/lookup_table_op.h" +#include "paddle/fluid/framework/var_type_inference.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lookup_table_op.cu b/paddle/fluid/operators/lookup_table_op.cu index 9684b6d4612..801adba5a44 100644 --- a/paddle/fluid/operators/lookup_table_op.cu +++ b/paddle/fluid/operators/lookup_table_op.cu @@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/lookup_table_op.h" -#include "paddle/platform/assert.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/lookup_table_op.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lookup_table_op.h b/paddle/fluid/operators/lookup_table_op.h index 0842c422f7b..d264496882a 100644 --- a/paddle/fluid/operators/lookup_table_op.h +++ b/paddle/fluid/operators/lookup_table_op.h @@ -14,10 +14,10 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/selected_rows.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/selected_rows.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lrn_op.cc b/paddle/fluid/operators/lrn_op.cc index 95673ba19e7..c84507f231c 100644 --- a/paddle/fluid/operators/lrn_op.cc +++ b/paddle/fluid/operators/lrn_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lrn_op.h" +#include "paddle/fluid/operators/lrn_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lrn_op.cu b/paddle/fluid/operators/lrn_op.cu index eb9d66a73df..03112bf3e03 100644 --- a/paddle/fluid/operators/lrn_op.cu +++ b/paddle/fluid/operators/lrn_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lrn_op.h" +#include "paddle/fluid/operators/lrn_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lrn_op.h b/paddle/fluid/operators/lrn_op.h index ef3a2883a88..b7b78b45914 100644 --- a/paddle/fluid/operators/lrn_op.h +++ b/paddle/fluid/operators/lrn_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lstm_op.cc b/paddle/fluid/operators/lstm_op.cc index afb095a04e7..d1f1b5f235f 100644 --- a/paddle/fluid/operators/lstm_op.cc +++ b/paddle/fluid/operators/lstm_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lstm_op.h" +#include "paddle/fluid/operators/lstm_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lstm_op.cu.cc b/paddle/fluid/operators/lstm_op.cu.cc index cfcc1fc92a0..679d02b1f9a 100644 --- a/paddle/fluid/operators/lstm_op.cu.cc +++ b/paddle/fluid/operators/lstm_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lstm_op.h" +#include "paddle/fluid/operators/lstm_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/lstm_op.h b/paddle/fluid/operators/lstm_op.h index 72e95b75e29..1c48495533c 100644 --- a/paddle/fluid/operators/lstm_op.h +++ b/paddle/fluid/operators/lstm_op.h @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/operators/math/lstm_compute.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/sequence2batch.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/lstm_compute.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence2batch.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lstm_unit_op.cc b/paddle/fluid/operators/lstm_unit_op.cc index c2d2c439825..3d33d47e0c3 100644 --- a/paddle/fluid/operators/lstm_unit_op.cc +++ b/paddle/fluid/operators/lstm_unit_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lstm_unit_op.h" +#include "paddle/fluid/operators/lstm_unit_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lstm_unit_op.cu b/paddle/fluid/operators/lstm_unit_op.cu index 5ee5ddd280f..12ebffca37f 100644 --- a/paddle/fluid/operators/lstm_unit_op.cu +++ b/paddle/fluid/operators/lstm_unit_op.cu @@ -16,10 +16,10 @@ limitations under the License. */ https://github.com/caffe2/caffe2/blob/master/caffe2/operators/lstm_unit_op_gpu.cu */ -#include "paddle/framework/op_registry.h" -#include "paddle/operators/cross_entropy_op.h" -#include "paddle/platform/assert.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/cross_entropy_op.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lstm_unit_op.h b/paddle/fluid/operators/lstm_unit_op.h index fa8d141bcb6..9f2370fe690 100644 --- a/paddle/fluid/operators/lstm_unit_op.h +++ b/paddle/fluid/operators/lstm_unit_op.h @@ -18,7 +18,7 @@ https://github.com/caffe2/caffe2/blob/master/caffe2/operators/lstm_unit_op.h #pragma once #include "glog/logging.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lstmp_op.cc b/paddle/fluid/operators/lstmp_op.cc index c96b30ba353..2d30edf5c3c 100644 --- a/paddle/fluid/operators/lstmp_op.cc +++ b/paddle/fluid/operators/lstmp_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lstmp_op.h" +#include "paddle/fluid/operators/lstmp_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/lstmp_op.cu b/paddle/fluid/operators/lstmp_op.cu index 7fcbcfecc87..bcefb94c75b 100644 --- a/paddle/fluid/operators/lstmp_op.cu +++ b/paddle/fluid/operators/lstmp_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/lstmp_op.h" +#include "paddle/fluid/operators/lstmp_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/lstmp_op.h b/paddle/fluid/operators/lstmp_op.h index e064a155dfa..22ef4721860 100644 --- a/paddle/fluid/operators/lstmp_op.h +++ b/paddle/fluid/operators/lstmp_op.h @@ -13,14 +13,14 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/operators/activation_op.h" -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/operators/math/lstm_compute.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/sequence2batch.h" - -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/operators/activation_op.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/lstm_compute.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence2batch.h" + +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/margin_rank_loss_op.cc b/paddle/fluid/operators/margin_rank_loss_op.cc index e0df3077742..fc31befb205 100644 --- a/paddle/fluid/operators/margin_rank_loss_op.cc +++ b/paddle/fluid/operators/margin_rank_loss_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/margin_rank_loss_op.h" +#include "paddle/fluid/operators/margin_rank_loss_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/margin_rank_loss_op.cu b/paddle/fluid/operators/margin_rank_loss_op.cu index 798c3ed182b..ca4593a48d6 100644 --- a/paddle/fluid/operators/margin_rank_loss_op.cu +++ b/paddle/fluid/operators/margin_rank_loss_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/margin_rank_loss_op.h" +#include "paddle/fluid/operators/margin_rank_loss_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/margin_rank_loss_op.h b/paddle/fluid/operators/margin_rank_loss_op.h index 7438e881e1c..934a5da0f80 100644 --- a/paddle/fluid/operators/margin_rank_loss_op.h +++ b/paddle/fluid/operators/margin_rank_loss_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/context_project.cc b/paddle/fluid/operators/math/context_project.cc index 980dd90df87..b73d976d1b3 100644 --- a/paddle/fluid/operators/math/context_project.cc +++ b/paddle/fluid/operators/math/context_project.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/context_project.h" +#include "paddle/fluid/operators/math/context_project.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/context_project.cu b/paddle/fluid/operators/math/context_project.cu index 934e3df6459..bbd36a6e8f5 100644 --- a/paddle/fluid/operators/math/context_project.cu +++ b/paddle/fluid/operators/math/context_project.cu @@ -14,7 +14,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/math/context_project.h" +#include "paddle/fluid/operators/math/context_project.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/context_project.h b/paddle/fluid/operators/math/context_project.h index 218de9fb956..2fe593ec3af 100644 --- a/paddle/fluid/operators/math/context_project.h +++ b/paddle/fluid/operators/math/context_project.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor.h" -#include "paddle/operators/math/im2col.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/operators/math/im2col.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/cos_sim_functor.cc b/paddle/fluid/operators/math/cos_sim_functor.cc index 6af9f0fcd96..701a9c23c0d 100644 --- a/paddle/fluid/operators/math/cos_sim_functor.cc +++ b/paddle/fluid/operators/math/cos_sim_functor.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/cos_sim_functor.h" +#include "paddle/fluid/operators/math/cos_sim_functor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/cos_sim_functor.cu b/paddle/fluid/operators/math/cos_sim_functor.cu index 6eb0a4ea4c5..0323680870a 100644 --- a/paddle/fluid/operators/math/cos_sim_functor.cu +++ b/paddle/fluid/operators/math/cos_sim_functor.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/cos_sim_functor.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/cos_sim_functor.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/cos_sim_functor.h b/paddle/fluid/operators/math/cos_sim_functor.h index aae8ab5b7a9..445d94f975f 100644 --- a/paddle/fluid/operators/math/cos_sim_functor.h +++ b/paddle/fluid/operators/math/cos_sim_functor.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include #include -#include "paddle/platform/device_context.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/cross_entropy.cc b/paddle/fluid/operators/math/cross_entropy.cc index d9cb016fb44..76abd03ff8b 100644 --- a/paddle/fluid/operators/math/cross_entropy.cc +++ b/paddle/fluid/operators/math/cross_entropy.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/cross_entropy.h" +#include "paddle/fluid/operators/math/cross_entropy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/cross_entropy.cu b/paddle/fluid/operators/math/cross_entropy.cu index 16c9e7b28ec..39222c484c2 100644 --- a/paddle/fluid/operators/math/cross_entropy.cu +++ b/paddle/fluid/operators/math/cross_entropy.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/cross_entropy.h" +#include "paddle/fluid/operators/math/cross_entropy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/cross_entropy.h b/paddle/fluid/operators/math/cross_entropy.h index b3b6d767a8b..2fe216a8053 100644 --- a/paddle/fluid/operators/math/cross_entropy.h +++ b/paddle/fluid/operators/math/cross_entropy.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/depthwise_conv.cu b/paddle/fluid/operators/math/depthwise_conv.cu index b212e782083..7b75e593071 100644 --- a/paddle/fluid/operators/math/depthwise_conv.cu +++ b/paddle/fluid/operators/math/depthwise_conv.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/depthwise_conv.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/depthwise_conv.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/depthwise_conv.h b/paddle/fluid/operators/math/depthwise_conv.h index 4708920bb42..c3081e7a0de 100644 --- a/paddle/fluid/operators/math/depthwise_conv.h +++ b/paddle/fluid/operators/math/depthwise_conv.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/detail/activation_functions.h b/paddle/fluid/operators/math/detail/activation_functions.h index 585a0123437..3af7ba790c4 100644 --- a/paddle/fluid/operators/math/detail/activation_functions.h +++ b/paddle/fluid/operators/math/detail/activation_functions.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/platform/enforce.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/hostdevice.h" #ifdef __AVX__ #include diff --git a/paddle/fluid/operators/math/detail/avx_functions.cc b/paddle/fluid/operators/math/detail/avx_functions.cc index 921364788cd..838cd30e3d5 100644 --- a/paddle/fluid/operators/math/detail/avx_functions.cc +++ b/paddle/fluid/operators/math/detail/avx_functions.cc @@ -15,7 +15,7 @@ limitations under the License. */ #ifdef __AVX__ #include -#include "paddle/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" // TODO(qingqing) refine this dependence #include "paddle/cuda/src/avx_mathfun.h" diff --git a/paddle/fluid/operators/math/detail/gru_cpu_kernel.h b/paddle/fluid/operators/math/detail/gru_cpu_kernel.h index a61b232f427..75c5c8eb29a 100644 --- a/paddle/fluid/operators/math/detail/gru_cpu_kernel.h +++ b/paddle/fluid/operators/math/detail/gru_cpu_kernel.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/operators/math/gru_compute.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/gru_compute.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/detail/gru_gpu_kernel.h b/paddle/fluid/operators/math/detail/gru_gpu_kernel.h index 1783d460968..fbf69d4a858 100644 --- a/paddle/fluid/operators/math/detail/gru_gpu_kernel.h +++ b/paddle/fluid/operators/math/detail/gru_gpu_kernel.h @@ -14,10 +14,10 @@ limitations under the License. */ #pragma once #include -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/operators/math/gru_compute.h" -#include "paddle/platform/cuda_helper.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/gru_compute.h" +#include "paddle/fluid/platform/cuda_helper.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/detail/gru_kernel.h b/paddle/fluid/operators/math/detail/gru_kernel.h index 4d8245cb5d0..705787e2ff7 100644 --- a/paddle/fluid/operators/math/detail/gru_kernel.h +++ b/paddle/fluid/operators/math/detail/gru_kernel.h @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/platform/hostdevice.h" #include diff --git a/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h b/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h index 42888fcdb0a..bf26509ba17 100644 --- a/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h +++ b/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/operators/math/lstm_compute.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/lstm_compute.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/detail/lstm_gpu_kernel.h b/paddle/fluid/operators/math/detail/lstm_gpu_kernel.h index e31e657e8b6..7865d0c0ba1 100644 --- a/paddle/fluid/operators/math/detail/lstm_gpu_kernel.h +++ b/paddle/fluid/operators/math/detail/lstm_gpu_kernel.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/operators/math/lstm_compute.h" -#include "paddle/platform/cuda_helper.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/operators/math/lstm_compute.h" +#include "paddle/fluid/platform/cuda_helper.h" +#include "paddle/fluid/platform/device_context.h" #include diff --git a/paddle/fluid/operators/math/detail/lstm_kernel.h b/paddle/fluid/operators/math/detail/lstm_kernel.h index fed8f9c4ca4..0679cc62ba9 100644 --- a/paddle/fluid/operators/math/detail/lstm_kernel.h +++ b/paddle/fluid/operators/math/detail/lstm_kernel.h @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/platform/hostdevice.h" #include diff --git a/paddle/fluid/operators/math/detection_util.h b/paddle/fluid/operators/math/detection_util.h index e3a3ef2badc..13e5d406c11 100644 --- a/paddle/fluid/operators/math/detection_util.h +++ b/paddle/fluid/operators/math/detection_util.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once #include -#include "paddle/framework/selected_rows.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/gru_compute.cc b/paddle/fluid/operators/math/gru_compute.cc index 101ab859624..10031804167 100644 --- a/paddle/fluid/operators/math/gru_compute.cc +++ b/paddle/fluid/operators/math/gru_compute.cc @@ -9,10 +9,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/gru_compute.h" -#include "paddle/operators/math/detail/gru_cpu_kernel.h" -#include "paddle/operators/math/detail/gru_kernel.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/gru_compute.h" +#include "paddle/fluid/operators/math/detail/gru_cpu_kernel.h" +#include "paddle/fluid/operators/math/detail/gru_kernel.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/gru_compute.cu b/paddle/fluid/operators/math/gru_compute.cu index d5a0e630ea0..0d5d5d7a743 100644 --- a/paddle/fluid/operators/math/gru_compute.cu +++ b/paddle/fluid/operators/math/gru_compute.cu @@ -9,10 +9,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/detail/gru_gpu_kernel.h" -#include "paddle/operators/math/detail/gru_kernel.h" -#include "paddle/operators/math/gru_compute.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/detail/gru_gpu_kernel.h" +#include "paddle/fluid/operators/math/detail/gru_kernel.h" +#include "paddle/fluid/operators/math/gru_compute.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/gru_compute.h b/paddle/fluid/operators/math/gru_compute.h index bf69147b506..93e19cf5578 100644 --- a/paddle/fluid/operators/math/gru_compute.h +++ b/paddle/fluid/operators/math/gru_compute.h @@ -11,9 +11,9 @@ limitations under the License. */ #pragma once -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/im2col.cc b/paddle/fluid/operators/math/im2col.cc index c2633b2e164..c298b00bb4c 100644 --- a/paddle/fluid/operators/math/im2col.cc +++ b/paddle/fluid/operators/math/im2col.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/im2col.h" +#include "paddle/fluid/operators/math/im2col.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/im2col.cu b/paddle/fluid/operators/math/im2col.cu index a88e837b030..c26343aacf5 100644 --- a/paddle/fluid/operators/math/im2col.cu +++ b/paddle/fluid/operators/math/im2col.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/im2col.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/im2col.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/im2col.h b/paddle/fluid/operators/math/im2col.h index 38f2c9fe0ad..525c0f5dda1 100644 --- a/paddle/fluid/operators/math/im2col.h +++ b/paddle/fluid/operators/math/im2col.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" -#include "paddle/framework/tensor_util.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/tensor_util.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/im2col_test.cc b/paddle/fluid/operators/math/im2col_test.cc index 1ba24325ffe..59d6a84b892 100644 --- a/paddle/fluid/operators/math/im2col_test.cc +++ b/paddle/fluid/operators/math/im2col_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/im2col.h" +#include "paddle/fluid/operators/math/im2col.h" #include template diff --git a/paddle/fluid/operators/math/lstm_compute.cc b/paddle/fluid/operators/math/lstm_compute.cc index d453102ecef..09eb89ec58d 100644 --- a/paddle/fluid/operators/math/lstm_compute.cc +++ b/paddle/fluid/operators/math/lstm_compute.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/lstm_compute.h" -#include "paddle/operators/math/detail/lstm_cpu_kernel.h" -#include "paddle/operators/math/detail/lstm_kernel.h" +#include "paddle/fluid/operators/math/lstm_compute.h" +#include "paddle/fluid/operators/math/detail/lstm_cpu_kernel.h" +#include "paddle/fluid/operators/math/detail/lstm_kernel.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/lstm_compute.cu b/paddle/fluid/operators/math/lstm_compute.cu index 82065d699f7..adedee28bd0 100644 --- a/paddle/fluid/operators/math/lstm_compute.cu +++ b/paddle/fluid/operators/math/lstm_compute.cu @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/detail/lstm_gpu_kernel.h" -#include "paddle/operators/math/detail/lstm_kernel.h" -#include "paddle/operators/math/lstm_compute.h" +#include "paddle/fluid/operators/math/detail/lstm_gpu_kernel.h" +#include "paddle/fluid/operators/math/detail/lstm_kernel.h" +#include "paddle/fluid/operators/math/lstm_compute.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/lstm_compute.h b/paddle/fluid/operators/math/lstm_compute.h index e1ad6b64d20..8610e96cf1a 100644 --- a/paddle/fluid/operators/math/lstm_compute.h +++ b/paddle/fluid/operators/math/lstm_compute.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/operators/math/detail/activation_functions.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/operators/math/detail/activation_functions.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/math_function.cc b/paddle/fluid/operators/math/math_function.cc index ce0a5f6cff8..2636dbddde6 100644 --- a/paddle/fluid/operators/math/math_function.cc +++ b/paddle/fluid/operators/math/math_function.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/math_function.h" -#include "paddle/framework/data_type.h" -#include "paddle/operators/math/math_function_impl.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/operators/math/math_function_impl.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/math_function.cu b/paddle/fluid/operators/math/math_function.cu index c0a107470a4..5764da71c84 100644 --- a/paddle/fluid/operators/math/math_function.cu +++ b/paddle/fluid/operators/math/math_function.cu @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/framework/data_type.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/math_function_impl.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function_impl.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/math_function.h b/paddle/fluid/operators/math/math_function.h index cb14d1e5746..84916af1f8e 100644 --- a/paddle/fluid/operators/math/math_function.h +++ b/paddle/fluid/operators/math/math_function.h @@ -47,11 +47,11 @@ int LAPACKE_dgetri(int matrix_layout, int n, double* a, int lda, #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/tensor.h" -#include "paddle/framework/tensor_util.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/tensor_util.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/math_function_impl.h b/paddle/fluid/operators/math/math_function_impl.h index af4127788af..a55ed6c58ba 100644 --- a/paddle/fluid/operators/math/math_function_impl.h +++ b/paddle/fluid/operators/math/math_function_impl.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/data_type.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/math_function_test.cc b/paddle/fluid/operators/math/math_function_test.cc index c9f322b92e5..6cd8e8b35ab 100644 --- a/paddle/fluid/operators/math/math_function_test.cc +++ b/paddle/fluid/operators/math/math_function_test.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function.h" #include "gtest/gtest.h" TEST(math_function, gemm_notrans_cblas) { diff --git a/paddle/fluid/operators/math/math_function_test.cu b/paddle/fluid/operators/math/math_function_test.cu index 6f16d667924..2ef53a82099 100644 --- a/paddle/fluid/operators/math/math_function_test.cu +++ b/paddle/fluid/operators/math/math_function_test.cu @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "gtest/gtest.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function.h" TEST(math_function, notrans_mul_trans) { paddle::framework::Tensor input1; diff --git a/paddle/fluid/operators/math/matmul.h b/paddle/fluid/operators/math/matmul.h index ae7f1fe9be5..50f79979d99 100644 --- a/paddle/fluid/operators/math/matmul.h +++ b/paddle/fluid/operators/math/matmul.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/maxouting.cc b/paddle/fluid/operators/math/maxouting.cc index fea86675f75..746328cd45a 100644 --- a/paddle/fluid/operators/math/maxouting.cc +++ b/paddle/fluid/operators/math/maxouting.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/maxouting.h" +#include "paddle/fluid/operators/math/maxouting.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/maxouting.cu b/paddle/fluid/operators/math/maxouting.cu index 6056ad251c1..68e5dfc3c55 100644 --- a/paddle/fluid/operators/math/maxouting.cu +++ b/paddle/fluid/operators/math/maxouting.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/maxouting.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/maxouting.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/maxouting.h b/paddle/fluid/operators/math/maxouting.h index 68f4743db07..0e81790f0ab 100644 --- a/paddle/fluid/operators/math/maxouting.h +++ b/paddle/fluid/operators/math/maxouting.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/pooling.cc b/paddle/fluid/operators/math/pooling.cc index 150de6fd59e..9adb142f14e 100644 --- a/paddle/fluid/operators/math/pooling.cc +++ b/paddle/fluid/operators/math/pooling.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/pooling.h" +#include "paddle/fluid/operators/math/pooling.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/pooling.cu b/paddle/fluid/operators/math/pooling.cu index 0243cf8316a..c65632de906 100644 --- a/paddle/fluid/operators/math/pooling.cu +++ b/paddle/fluid/operators/math/pooling.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/pooling.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/pooling.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/pooling.h b/paddle/fluid/operators/math/pooling.h index 2759f06cb6a..1195038f6a0 100644 --- a/paddle/fluid/operators/math/pooling.h +++ b/paddle/fluid/operators/math/pooling.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/selected_rows_functor.cc b/paddle/fluid/operators/math/selected_rows_functor.cc index 4e15d01a307..01aa37ab35c 100644 --- a/paddle/fluid/operators/math/selected_rows_functor.cc +++ b/paddle/fluid/operators/math/selected_rows_functor.cc @@ -14,8 +14,8 @@ limitations under the License. */ #include -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/selected_rows_functor.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/selected_rows_functor.cu b/paddle/fluid/operators/math/selected_rows_functor.cu index 54a41a67d06..ee3b5d52058 100644 --- a/paddle/fluid/operators/math/selected_rows_functor.cu +++ b/paddle/fluid/operators/math/selected_rows_functor.cu @@ -14,9 +14,9 @@ limitations under the License. */ #include -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/selected_rows_functor.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/selected_rows_functor.h b/paddle/fluid/operators/math/selected_rows_functor.h index 09d4631905f..510a9ed8be6 100644 --- a/paddle/fluid/operators/math/selected_rows_functor.h +++ b/paddle/fluid/operators/math/selected_rows_functor.h @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/platform/device_context.h" #define INLINE_FOR2(sizei, sizej) \ for (int64_t i = 0; i < sizei; i++) \ diff --git a/paddle/fluid/operators/math/selected_rows_functor_test.cc b/paddle/fluid/operators/math/selected_rows_functor_test.cc index 8c74cab0a1e..db6b41cd520 100644 --- a/paddle/fluid/operators/math/selected_rows_functor_test.cc +++ b/paddle/fluid/operators/math/selected_rows_functor_test.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/selected_rows_functor.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" #include "gtest/gtest.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function.h" TEST(selected_rows_functor, cpu_add) { using namespace paddle::framework; diff --git a/paddle/fluid/operators/math/selected_rows_functor_test.cu b/paddle/fluid/operators/math/selected_rows_functor_test.cu index 38808e13014..b3c4bc9244f 100644 --- a/paddle/fluid/operators/math/selected_rows_functor_test.cu +++ b/paddle/fluid/operators/math/selected_rows_functor_test.cu @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "gtest/gtest.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/selected_rows_functor.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" TEST(selected_rows_functor, gpu_add) { using namespace paddle::framework; diff --git a/paddle/fluid/operators/math/sequence2batch.cc b/paddle/fluid/operators/math/sequence2batch.cc index 17abce1c2f8..0485070fd9b 100644 --- a/paddle/fluid/operators/math/sequence2batch.cc +++ b/paddle/fluid/operators/math/sequence2batch.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/sequence2batch.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence2batch.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence2batch.cu b/paddle/fluid/operators/math/sequence2batch.cu index eaed2c30a80..450be80ea2f 100644 --- a/paddle/fluid/operators/math/sequence2batch.cu +++ b/paddle/fluid/operators/math/sequence2batch.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/math/sequence2batch.h" +#include "paddle/fluid/operators/math/sequence2batch.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence2batch.h b/paddle/fluid/operators/math/sequence2batch.h index 6db0427b417..00bd25ab613 100644 --- a/paddle/fluid/operators/math/sequence2batch.h +++ b/paddle/fluid/operators/math/sequence2batch.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_padding.cc b/paddle/fluid/operators/math/sequence_padding.cc index 2e69aa47eb8..ad8cd825676 100644 --- a/paddle/fluid/operators/math/sequence_padding.cc +++ b/paddle/fluid/operators/math/sequence_padding.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/sequence_padding.h" +#include "paddle/fluid/operators/math/sequence_padding.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_padding.cu b/paddle/fluid/operators/math/sequence_padding.cu index c2bd56448aa..c1a39057784 100644 --- a/paddle/fluid/operators/math/sequence_padding.cu +++ b/paddle/fluid/operators/math/sequence_padding.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/sequence_padding.h" +#include "paddle/fluid/operators/math/sequence_padding.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_padding.h b/paddle/fluid/operators/math/sequence_padding.h index 8f586c5eb46..0d84f9dcb38 100644 --- a/paddle/fluid/operators/math/sequence_padding.h +++ b/paddle/fluid/operators/math/sequence_padding.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_padding_test.cc b/paddle/fluid/operators/math/sequence_padding_test.cc index 3e504f4a15c..147cb37da2b 100644 --- a/paddle/fluid/operators/math/sequence_padding_test.cc +++ b/paddle/fluid/operators/math/sequence_padding_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/sequence_padding.h" +#include "paddle/fluid/operators/math/sequence_padding.h" #include template diff --git a/paddle/fluid/operators/math/sequence_pooling.cc b/paddle/fluid/operators/math/sequence_pooling.cc index 8fb92b1a130..b3b87ec93e1 100644 --- a/paddle/fluid/operators/math/sequence_pooling.cc +++ b/paddle/fluid/operators/math/sequence_pooling.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/sequence_pooling.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence_pooling.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_pooling.cu b/paddle/fluid/operators/math/sequence_pooling.cu index c69bd3da7e7..c4267e992a7 100644 --- a/paddle/fluid/operators/math/sequence_pooling.cu +++ b/paddle/fluid/operators/math/sequence_pooling.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/sequence_pooling.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence_pooling.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_pooling.h b/paddle/fluid/operators/math/sequence_pooling.h index 13ffb2ebef3..9ba9cad74b5 100644 --- a/paddle/fluid/operators/math/sequence_pooling.h +++ b/paddle/fluid/operators/math/sequence_pooling.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_scale.cc b/paddle/fluid/operators/math/sequence_scale.cc index 7e439e9a2ce..427689b9718 100644 --- a/paddle/fluid/operators/math/sequence_scale.cc +++ b/paddle/fluid/operators/math/sequence_scale.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/sequence_scale.h" +#include "paddle/fluid/operators/math/sequence_scale.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_scale.cu b/paddle/fluid/operators/math/sequence_scale.cu index 7cb9242db93..7c081ed7f45 100644 --- a/paddle/fluid/operators/math/sequence_scale.cu +++ b/paddle/fluid/operators/math/sequence_scale.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/sequence_scale.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/sequence_scale.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/sequence_scale.h b/paddle/fluid/operators/math/sequence_scale.h index ecd9a57c3f4..e8e07fd3156 100644 --- a/paddle/fluid/operators/math/sequence_scale.h +++ b/paddle/fluid/operators/math/sequence_scale.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/lod_tensor.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/softmax.cc b/paddle/fluid/operators/math/softmax.cc index 72f10f35f4e..eab31ec567d 100644 --- a/paddle/fluid/operators/math/softmax.cc +++ b/paddle/fluid/operators/math/softmax.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/softmax.h" -#include "paddle/operators/math/softmax_impl.h" +#include "paddle/fluid/operators/math/softmax.h" +#include "paddle/fluid/operators/math/softmax_impl.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/softmax.cu b/paddle/fluid/operators/math/softmax.cu index 9e73f6a371c..733d7eeee6d 100644 --- a/paddle/fluid/operators/math/softmax.cu +++ b/paddle/fluid/operators/math/softmax.cu @@ -14,8 +14,8 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/math/softmax.h" -#include "paddle/operators/math/softmax_impl.h" +#include "paddle/fluid/operators/math/softmax.h" +#include "paddle/fluid/operators/math/softmax_impl.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/softmax.h b/paddle/fluid/operators/math/softmax.h index 471f44d340c..b7d67d5f12d 100644 --- a/paddle/fluid/operators/math/softmax.h +++ b/paddle/fluid/operators/math/softmax.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" +#include "paddle/fluid/framework/tensor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/softmax_impl.h b/paddle/fluid/operators/math/softmax_impl.h index 82f597ff792..f7c61cb647e 100644 --- a/paddle/fluid/operators/math/softmax_impl.h +++ b/paddle/fluid/operators/math/softmax_impl.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/tensor.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/tensor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/unpooling.cc b/paddle/fluid/operators/math/unpooling.cc index ecd3a647e00..e02bc02e002 100644 --- a/paddle/fluid/operators/math/unpooling.cc +++ b/paddle/fluid/operators/math/unpooling.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/unpooling.h" +#include "paddle/fluid/operators/math/unpooling.h" namespace paddle { namespace operators { namespace math { diff --git a/paddle/fluid/operators/math/unpooling.cu b/paddle/fluid/operators/math/unpooling.cu index ecbde0f6a79..2e74270fdf1 100644 --- a/paddle/fluid/operators/math/unpooling.cu +++ b/paddle/fluid/operators/math/unpooling.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/unpooling.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/unpooling.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/unpooling.h b/paddle/fluid/operators/math/unpooling.h index 0f0ff1371eb..f245ba7ba87 100644 --- a/paddle/fluid/operators/math/unpooling.h +++ b/paddle/fluid/operators/math/unpooling.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" +#include "paddle/fluid/framework/tensor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/vol2col.cc b/paddle/fluid/operators/math/vol2col.cc index d574ed92343..ded0bbc7447 100644 --- a/paddle/fluid/operators/math/vol2col.cc +++ b/paddle/fluid/operators/math/vol2col.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/vol2col.h" +#include "paddle/fluid/operators/math/vol2col.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/vol2col.cu b/paddle/fluid/operators/math/vol2col.cu index b029442fe48..35ef24c7f5f 100644 --- a/paddle/fluid/operators/math/vol2col.cu +++ b/paddle/fluid/operators/math/vol2col.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/vol2col.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/vol2col.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/vol2col.h b/paddle/fluid/operators/math/vol2col.h index dcd80370e85..3ce38b2d11f 100644 --- a/paddle/fluid/operators/math/vol2col.h +++ b/paddle/fluid/operators/math/vol2col.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" -#include "paddle/framework/tensor_util.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/framework/tensor_util.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/vol2col_test.cc b/paddle/fluid/operators/math/vol2col_test.cc index 7a308ca8140..af0a900f80e 100644 --- a/paddle/fluid/operators/math/vol2col_test.cc +++ b/paddle/fluid/operators/math/vol2col_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/vol2col.h" +#include "paddle/fluid/operators/math/vol2col.h" #include #include diff --git a/paddle/fluid/operators/matmul_op.cc b/paddle/fluid/operators/matmul_op.cc index 3336978c8d8..267b0057bf4 100644 --- a/paddle/fluid/operators/matmul_op.cc +++ b/paddle/fluid/operators/matmul_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/matmul_op.h" +#include "paddle/fluid/operators/matmul_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/matmul_op.cu.cc b/paddle/fluid/operators/matmul_op.cu.cc index d28d12164e4..988787f0fe4 100644 --- a/paddle/fluid/operators/matmul_op.cu.cc +++ b/paddle/fluid/operators/matmul_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/matmul_op.h" +#include "paddle/fluid/operators/matmul_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/matmul_op.h b/paddle/fluid/operators/matmul_op.h index fe6a97465f8..f4cae3c91cb 100644 --- a/paddle/fluid/operators/matmul_op.h +++ b/paddle/fluid/operators/matmul_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/matmul.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/matmul.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/max_sequence_len_op.cc b/paddle/fluid/operators/max_sequence_len_op.cc index 019150e4914..eff8b927e52 100644 --- a/paddle/fluid/operators/max_sequence_len_op.cc +++ b/paddle/fluid/operators/max_sequence_len_op.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/maxout_op.cc b/paddle/fluid/operators/maxout_op.cc index 3ee32269417..8ce12cd4c4d 100644 --- a/paddle/fluid/operators/maxout_op.cc +++ b/paddle/fluid/operators/maxout_op.cc @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "paddle/operators/maxout_op.h" +#include "paddle/fluid/operators/maxout_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/maxout_op.cu.cc b/paddle/fluid/operators/maxout_op.cu.cc index c4a2d676d3a..f3f45c90cde 100644 --- a/paddle/fluid/operators/maxout_op.cu.cc +++ b/paddle/fluid/operators/maxout_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/maxout_op.h" +#include "paddle/fluid/operators/maxout_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/maxout_op.h b/paddle/fluid/operators/maxout_op.h index e8b12552b9f..e5de3e3760b 100644 --- a/paddle/fluid/operators/maxout_op.h +++ b/paddle/fluid/operators/maxout_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/maxouting.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/maxouting.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/mean_op.cc b/paddle/fluid/operators/mean_op.cc index 411f4d14efb..1043820345a 100644 --- a/paddle/fluid/operators/mean_op.cc +++ b/paddle/fluid/operators/mean_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/mean_op.h" +#include "paddle/fluid/operators/mean_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/mean_op.cu b/paddle/fluid/operators/mean_op.cu index 212d4481138..ccf2248760a 100644 --- a/paddle/fluid/operators/mean_op.cu +++ b/paddle/fluid/operators/mean_op.cu @@ -14,7 +14,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/mean_op.h" +#include "paddle/fluid/operators/mean_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/mean_op.h b/paddle/fluid/operators/mean_op.h index 351b3459597..ae162287da6 100644 --- a/paddle/fluid/operators/mean_op.h +++ b/paddle/fluid/operators/mean_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/merge_lod_tensor_op.cc b/paddle/fluid/operators/merge_lod_tensor_op.cc index 87644d316d4..255f5533409 100644 --- a/paddle/fluid/operators/merge_lod_tensor_op.cc +++ b/paddle/fluid/operators/merge_lod_tensor_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/memory/memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/memory/memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/mine_hard_examples_op.cc b/paddle/fluid/operators/mine_hard_examples_op.cc index 051cc24706d..73a6c0b6793 100644 --- a/paddle/fluid/operators/mine_hard_examples_op.cc +++ b/paddle/fluid/operators/mine_hard_examples_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/minus_op.cc b/paddle/fluid/operators/minus_op.cc index 3d7742dd4bc..8a35d668ccf 100644 --- a/paddle/fluid/operators/minus_op.cc +++ b/paddle/fluid/operators/minus_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/minus_op.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/operators/minus_op.h" +#include "paddle/fluid/operators/net_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/minus_op.cu b/paddle/fluid/operators/minus_op.cu index 80cd9f7c168..ce0b1fdc041 100644 --- a/paddle/fluid/operators/minus_op.cu +++ b/paddle/fluid/operators/minus_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/minus_op.h" +#include "paddle/fluid/operators/minus_op.h" REGISTER_OP_CUDA_KERNEL( minus, diff --git a/paddle/fluid/operators/minus_op.h b/paddle/fluid/operators/minus_op.h index 20760b8cd5b..dc94cbbeca2 100644 --- a/paddle/fluid/operators/minus_op.h +++ b/paddle/fluid/operators/minus_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/modified_huber_loss_op.cc b/paddle/fluid/operators/modified_huber_loss_op.cc index f5d69071a86..f2d16531658 100644 --- a/paddle/fluid/operators/modified_huber_loss_op.cc +++ b/paddle/fluid/operators/modified_huber_loss_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/modified_huber_loss_op.h" +#include "paddle/fluid/operators/modified_huber_loss_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/modified_huber_loss_op.cu b/paddle/fluid/operators/modified_huber_loss_op.cu index 3d2a5562e8c..69ac2b1ed54 100644 --- a/paddle/fluid/operators/modified_huber_loss_op.cu +++ b/paddle/fluid/operators/modified_huber_loss_op.cu @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #include #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/modified_huber_loss_op.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/modified_huber_loss_op.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/modified_huber_loss_op.h b/paddle/fluid/operators/modified_huber_loss_op.h index 6ce86feee57..a470a45e13b 100644 --- a/paddle/fluid/operators/modified_huber_loss_op.h +++ b/paddle/fluid/operators/modified_huber_loss_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/momentum_op.cc b/paddle/fluid/operators/momentum_op.cc index 15b8b807767..a3950ac99da 100644 --- a/paddle/fluid/operators/momentum_op.cc +++ b/paddle/fluid/operators/momentum_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/momentum_op.h" +#include "paddle/fluid/operators/momentum_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/momentum_op.cu b/paddle/fluid/operators/momentum_op.cu index 2b9314162e6..28a14cd4b21 100644 --- a/paddle/fluid/operators/momentum_op.cu +++ b/paddle/fluid/operators/momentum_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/momentum_op.h b/paddle/fluid/operators/momentum_op.h index da69532ea58..fdab86b24ee 100644 --- a/paddle/fluid/operators/momentum_op.h +++ b/paddle/fluid/operators/momentum_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/mul_op.cc b/paddle/fluid/operators/mul_op.cc index c923e988a55..c9375d8ea12 100644 --- a/paddle/fluid/operators/mul_op.cc +++ b/paddle/fluid/operators/mul_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/mul_op.h" +#include "paddle/fluid/operators/mul_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/mul_op.cu.cc b/paddle/fluid/operators/mul_op.cu.cc index 43de9a71949..6f605fd84fb 100644 --- a/paddle/fluid/operators/mul_op.cu.cc +++ b/paddle/fluid/operators/mul_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/mul_op.h" +#include "paddle/fluid/operators/mul_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/mul_op.h b/paddle/fluid/operators/mul_op.h index 1fb0569b49c..745989f07f3 100644 --- a/paddle/fluid/operators/mul_op.h +++ b/paddle/fluid/operators/mul_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/operators/math/math_function.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/multiclass_nms_op.cc b/paddle/fluid/operators/multiclass_nms_op.cc index 41b9335fb8f..b2934f69cc9 100644 --- a/paddle/fluid/operators/multiclass_nms_op.cc +++ b/paddle/fluid/operators/multiclass_nms_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/multiplex_op.cc b/paddle/fluid/operators/multiplex_op.cc index d275fa5cbbf..f89b00376ba 100644 --- a/paddle/fluid/operators/multiplex_op.cc +++ b/paddle/fluid/operators/multiplex_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/multiplex_op.h" +#include "paddle/fluid/operators/multiplex_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/multiplex_op.cu b/paddle/fluid/operators/multiplex_op.cu index 546e6e7a24d..3ef7ef1dfcd 100644 --- a/paddle/fluid/operators/multiplex_op.cu +++ b/paddle/fluid/operators/multiplex_op.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/operators/multiplex_op.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/multiplex_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/multiplex_op.h b/paddle/fluid/operators/multiplex_op.h index ef66be5556e..682117cb1b4 100644 --- a/paddle/fluid/operators/multiplex_op.h +++ b/paddle/fluid/operators/multiplex_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/memory/memcpy.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/memory/memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/nccl/nccl_gpu_common.cc b/paddle/fluid/operators/nccl/nccl_gpu_common.cc index 1602a3d9b54..2a8ce932ec5 100644 --- a/paddle/fluid/operators/nccl/nccl_gpu_common.cc +++ b/paddle/fluid/operators/nccl/nccl_gpu_common.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/nccl/nccl_gpu_common.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/operators/nccl/nccl_gpu_common.h" +#include "paddle/fluid/platform/gpu_info.h" namespace paddle { namespace platform {} // namespace platform diff --git a/paddle/fluid/operators/nccl/nccl_gpu_common.h b/paddle/fluid/operators/nccl/nccl_gpu_common.h index 5173996f202..6e78613239e 100644 --- a/paddle/fluid/operators/nccl/nccl_gpu_common.h +++ b/paddle/fluid/operators/nccl/nccl_gpu_common.h @@ -22,10 +22,10 @@ limitations under the License. */ #include #include -#include "paddle/platform/device_context.h" -#include "paddle/platform/dynload/nccl.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/macros.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/dynload/nccl.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/macros.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/operators/nccl_op.cc b/paddle/fluid/operators/nccl_op.cc index 9d51153b063..52420ceba0d 100644 --- a/paddle/fluid/operators/nccl_op.cc +++ b/paddle/fluid/operators/nccl_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/operators/nccl/nccl_gpu_common.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/nccl/nccl_gpu_common.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/nccl_op.cu.cc b/paddle/fluid/operators/nccl_op.cu.cc index 1b986a13650..333aed2903e 100644 --- a/paddle/fluid/operators/nccl_op.cu.cc +++ b/paddle/fluid/operators/nccl_op.cu.cc @@ -11,9 +11,9 @@ limitations under the License. */ #include -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/nccl/nccl_gpu_common.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/nccl/nccl_gpu_common.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/nccl_op_test.cu.cc b/paddle/fluid/operators/nccl_op_test.cu.cc index 827a6253477..212ed2f9b63 100644 --- a/paddle/fluid/operators/nccl_op_test.cu.cc +++ b/paddle/fluid/operators/nccl_op_test.cu.cc @@ -21,17 +21,17 @@ limitations under the License. */ #include #include -#include "paddle/framework/block_desc.h" -#include "paddle/framework/init.h" -#include "paddle/framework/op_desc.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/program_desc.h" -#include "paddle/framework/var_desc.h" -#include "paddle/operators/nccl/nccl_gpu_common.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/gpu_info.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/framework/op_desc.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/program_desc.h" +#include "paddle/fluid/framework/var_desc.h" +#include "paddle/fluid/operators/nccl/nccl_gpu_common.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/gpu_info.h" +#include "paddle/fluid/platform/place.h" USE_NO_KERNEL_OP(ncclInit); USE_CUDA_ONLY_OP(ncclAllReduce); diff --git a/paddle/fluid/operators/nce_op.cc b/paddle/fluid/operators/nce_op.cc index 994ddf717e7..0841313a104 100644 --- a/paddle/fluid/operators/nce_op.cc +++ b/paddle/fluid/operators/nce_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/nce_op.h" +#include "paddle/fluid/operators/nce_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/nce_op.h b/paddle/fluid/operators/nce_op.h index 86fa13a649c..624c2d9bbd3 100644 --- a/paddle/fluid/operators/nce_op.h +++ b/paddle/fluid/operators/nce_op.h @@ -16,8 +16,8 @@ limitations under the License. */ #include #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" #include "unsupported/Eigen/CXX11/Tensor" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/net_op.cc b/paddle/fluid/operators/net_op.cc index 000e029840c..c0ca5873adc 100644 --- a/paddle/fluid/operators/net_op.cc +++ b/paddle/fluid/operators/net_op.cc @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/operators/net_op.h" +#include "paddle/fluid/operators/net_op.h" #include -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/net_op.h b/paddle/fluid/operators/net_op.h index b24042f5ef5..14e5909851c 100644 --- a/paddle/fluid/operators/net_op.h +++ b/paddle/fluid/operators/net_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/net_op_test.cc b/paddle/fluid/operators/net_op_test.cc index 9358f29f62f..cc20be0c817 100644 --- a/paddle/fluid/operators/net_op_test.cc +++ b/paddle/fluid/operators/net_op_test.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/operators/net_op.h" +#include "paddle/fluid/operators/net_op.h" #include diff --git a/paddle/fluid/operators/norm_op.cc b/paddle/fluid/operators/norm_op.cc index 0eeafcaae0a..ee85b1a90a8 100644 --- a/paddle/fluid/operators/norm_op.cc +++ b/paddle/fluid/operators/norm_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/norm_op.h" +#include "paddle/fluid/operators/norm_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/norm_op.cu b/paddle/fluid/operators/norm_op.cu index 2941c89b931..438bb3b86e7 100644 --- a/paddle/fluid/operators/norm_op.cu +++ b/paddle/fluid/operators/norm_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/norm_op.h" +#include "paddle/fluid/operators/norm_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/norm_op.h b/paddle/fluid/operators/norm_op.h index 5759d6f1f07..db74c9b02a7 100644 --- a/paddle/fluid/operators/norm_op.h +++ b/paddle/fluid/operators/norm_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/one_hot_op.cc b/paddle/fluid/operators/one_hot_op.cc index e78b7468de4..2c3a60da729 100644 --- a/paddle/fluid/operators/one_hot_op.cc +++ b/paddle/fluid/operators/one_hot_op.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/operators/one_hot_op.h" -#include "paddle/framework/framework.pb.h" +#include "paddle/fluid/operators/one_hot_op.h" +#include "paddle/fluid/framework/framework.pb.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/one_hot_op.cu b/paddle/fluid/operators/one_hot_op.cu index 16f6d9433ea..6a8061edaab 100644 --- a/paddle/fluid/operators/one_hot_op.cu +++ b/paddle/fluid/operators/one_hot_op.cu @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/operators/one_hot_op.h" -#include "paddle/platform/cuda_helper.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/operators/one_hot_op.h" +#include "paddle/fluid/platform/cuda_helper.h" +#include "paddle/fluid/platform/gpu_info.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/one_hot_op.h b/paddle/fluid/operators/one_hot_op.h index 12031ede2c3..ddac6edd0ec 100644 --- a/paddle/fluid/operators/one_hot_op.h +++ b/paddle/fluid/operators/one_hot_op.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/pad_op.cc b/paddle/fluid/operators/pad_op.cc index 90c53bd1773..4b021fde7cb 100644 --- a/paddle/fluid/operators/pad_op.cc +++ b/paddle/fluid/operators/pad_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/pad_op.h" +#include "paddle/fluid/operators/pad_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/pad_op.cu b/paddle/fluid/operators/pad_op.cu index 433b5f1112a..203c3144037 100644 --- a/paddle/fluid/operators/pad_op.cu +++ b/paddle/fluid/operators/pad_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/pad_op.h" +#include "paddle/fluid/operators/pad_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/pad_op.h b/paddle/fluid/operators/pad_op.h index fdf91a57766..244d8f9b6cf 100644 --- a/paddle/fluid/operators/pad_op.h +++ b/paddle/fluid/operators/pad_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/parallel_do_op.cc b/paddle/fluid/operators/parallel_do_op.cc index edb9de82509..e25df924799 100644 --- a/paddle/fluid/operators/parallel_do_op.cc +++ b/paddle/fluid/operators/parallel_do_op.cc @@ -14,10 +14,10 @@ limitations under the License. */ #include -#include "paddle/framework/executor.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/threadpool.h" -#include "paddle/operators/detail/safe_ref.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/threadpool.h" +#include "paddle/fluid/operators/detail/safe_ref.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/pool_cudnn_op.cu.cc b/paddle/fluid/operators/pool_cudnn_op.cu.cc index 446fb0819d9..75984b7721c 100644 --- a/paddle/fluid/operators/pool_cudnn_op.cu.cc +++ b/paddle/fluid/operators/pool_cudnn_op.cu.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/operators/pool_op.h" -#include "paddle/platform/cudnn_helper.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/pool_op.h" +#include "paddle/fluid/platform/cudnn_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/pool_op.cc b/paddle/fluid/operators/pool_op.cc index b97333bb1a1..9dd33eefc5f 100644 --- a/paddle/fluid/operators/pool_op.cc +++ b/paddle/fluid/operators/pool_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/pool_op.h" +#include "paddle/fluid/operators/pool_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/pool_op.cu.cc b/paddle/fluid/operators/pool_op.cu.cc index 39a9dfbf794..14486c07402 100644 --- a/paddle/fluid/operators/pool_op.cu.cc +++ b/paddle/fluid/operators/pool_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/pool_op.h" +#include "paddle/fluid/operators/pool_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/pool_op.h b/paddle/fluid/operators/pool_op.h index d6ba5e298a4..4cabd634d66 100644 --- a/paddle/fluid/operators/pool_op.h +++ b/paddle/fluid/operators/pool_op.h @@ -14,10 +14,10 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/pooling.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/pooling.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/pool_with_index_op.cc b/paddle/fluid/operators/pool_with_index_op.cc index 1d31d813af4..ef6d5d867b2 100644 --- a/paddle/fluid/operators/pool_with_index_op.cc +++ b/paddle/fluid/operators/pool_with_index_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/pool_with_index_op.h" +#include "paddle/fluid/operators/pool_with_index_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/pool_with_index_op.cu.cc b/paddle/fluid/operators/pool_with_index_op.cu.cc index 4c9804da639..722a4d1e2a4 100644 --- a/paddle/fluid/operators/pool_with_index_op.cu.cc +++ b/paddle/fluid/operators/pool_with_index_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/pool_with_index_op.h" +#include "paddle/fluid/operators/pool_with_index_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/pool_with_index_op.h b/paddle/fluid/operators/pool_with_index_op.h index 4f4087d1dd3..da7ef9df73a 100644 --- a/paddle/fluid/operators/pool_with_index_op.h +++ b/paddle/fluid/operators/pool_with_index_op.h @@ -14,10 +14,10 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/pooling.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/pooling.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/positive_negative_pair_op.cc b/paddle/fluid/operators/positive_negative_pair_op.cc index 5aa5167dbb8..d237da25a00 100644 --- a/paddle/fluid/operators/positive_negative_pair_op.cc +++ b/paddle/fluid/operators/positive_negative_pair_op.cc @@ -9,7 +9,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/positive_negative_pair_op.h" +#include "paddle/fluid/operators/positive_negative_pair_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/positive_negative_pair_op.h b/paddle/fluid/operators/positive_negative_pair_op.h index 977e59b7d2f..f20f33bbeb1 100644 --- a/paddle/fluid/operators/positive_negative_pair_op.h +++ b/paddle/fluid/operators/positive_negative_pair_op.h @@ -12,8 +12,8 @@ limitations under the License. */ #pragma once #include #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" #include "paddle/utils/Logging.h" namespace paddle { diff --git a/paddle/fluid/operators/precision_recall_op.cc b/paddle/fluid/operators/precision_recall_op.cc index f1598d53cae..30d594719c7 100644 --- a/paddle/fluid/operators/precision_recall_op.cc +++ b/paddle/fluid/operators/precision_recall_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/precision_recall_op.h" +#include "paddle/fluid/operators/precision_recall_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/precision_recall_op.h b/paddle/fluid/operators/precision_recall_op.h index c0d55405a36..7dae86b76fc 100644 --- a/paddle/fluid/operators/precision_recall_op.h +++ b/paddle/fluid/operators/precision_recall_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/prelu_op.cc b/paddle/fluid/operators/prelu_op.cc index ddc21a65702..22b970d9712 100644 --- a/paddle/fluid/operators/prelu_op.cc +++ b/paddle/fluid/operators/prelu_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/prelu_op.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/operators/prelu_op.h" +#include "paddle/fluid/operators/net_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/prelu_op.cu b/paddle/fluid/operators/prelu_op.cu index 1718bb5cd65..038b09a493c 100644 --- a/paddle/fluid/operators/prelu_op.cu +++ b/paddle/fluid/operators/prelu_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/prelu_op.h" +#include "paddle/fluid/operators/prelu_op.h" REGISTER_OP_CUDA_KERNEL( prelu, diff --git a/paddle/fluid/operators/prelu_op.h b/paddle/fluid/operators/prelu_op.h index 56f9a553ec1..85ad75d4790 100644 --- a/paddle/fluid/operators/prelu_op.h +++ b/paddle/fluid/operators/prelu_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/print_op.cc b/paddle/fluid/operators/print_op.cc index 8b233d64c90..3616545309e 100644 --- a/paddle/fluid/operators/print_op.cc +++ b/paddle/fluid/operators/print_op.cc @@ -15,8 +15,8 @@ #include #include -#include "paddle/framework/op_registry.h" -#include "paddle/framework/variable.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/variable.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/prior_box_op.cc b/paddle/fluid/operators/prior_box_op.cc index 1dc4b288559..ed48603e17f 100644 --- a/paddle/fluid/operators/prior_box_op.cc +++ b/paddle/fluid/operators/prior_box_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/prior_box_op.h" +#include "paddle/fluid/operators/prior_box_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/prior_box_op.h b/paddle/fluid/operators/prior_box_op.h index 6b221cb74eb..fd070412334 100644 --- a/paddle/fluid/operators/prior_box_op.h +++ b/paddle/fluid/operators/prior_box_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/platform/transform.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/proximal_adagrad_op.cc b/paddle/fluid/operators/proximal_adagrad_op.cc index b92f46b5bd4..d9e3894c576 100644 --- a/paddle/fluid/operators/proximal_adagrad_op.cc +++ b/paddle/fluid/operators/proximal_adagrad_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/proximal_adagrad_op.h" +#include "paddle/fluid/operators/proximal_adagrad_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/proximal_adagrad_op.cu b/paddle/fluid/operators/proximal_adagrad_op.cu index 42a178f94b9..54c75b3abb8 100644 --- a/paddle/fluid/operators/proximal_adagrad_op.cu +++ b/paddle/fluid/operators/proximal_adagrad_op.cu @@ -12,7 +12,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/proximal_adagrad_op.h" +#include "paddle/fluid/operators/proximal_adagrad_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/proximal_adagrad_op.h b/paddle/fluid/operators/proximal_adagrad_op.h index 523924d80e1..70205a8d11f 100644 --- a/paddle/fluid/operators/proximal_adagrad_op.h +++ b/paddle/fluid/operators/proximal_adagrad_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/proximal_gd_op.cc b/paddle/fluid/operators/proximal_gd_op.cc index 2d3bbdaf320..de7c6843c8b 100644 --- a/paddle/fluid/operators/proximal_gd_op.cc +++ b/paddle/fluid/operators/proximal_gd_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/proximal_gd_op.h" +#include "paddle/fluid/operators/proximal_gd_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/proximal_gd_op.cu b/paddle/fluid/operators/proximal_gd_op.cu index b7dd840d19a..97b672e872c 100644 --- a/paddle/fluid/operators/proximal_gd_op.cu +++ b/paddle/fluid/operators/proximal_gd_op.cu @@ -12,7 +12,7 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/proximal_gd_op.h" +#include "paddle/fluid/operators/proximal_gd_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/proximal_gd_op.h b/paddle/fluid/operators/proximal_gd_op.h index 64648b3ccaf..8372380f252 100644 --- a/paddle/fluid/operators/proximal_gd_op.h +++ b/paddle/fluid/operators/proximal_gd_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/rank_loss_op.cc b/paddle/fluid/operators/rank_loss_op.cc index f2164a0f805..222ca73d2ac 100644 --- a/paddle/fluid/operators/rank_loss_op.cc +++ b/paddle/fluid/operators/rank_loss_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/rank_loss_op.h" +#include "paddle/fluid/operators/rank_loss_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/rank_loss_op.cu b/paddle/fluid/operators/rank_loss_op.cu index 294b2273834..1b182ced70d 100644 --- a/paddle/fluid/operators/rank_loss_op.cu +++ b/paddle/fluid/operators/rank_loss_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/rank_loss_op.h" +#include "paddle/fluid/operators/rank_loss_op.h" REGISTER_OP_CUDA_KERNEL(rank_loss, paddle::operators::RankLossKernel< diff --git a/paddle/fluid/operators/rank_loss_op.h b/paddle/fluid/operators/rank_loss_op.h index bd0c49ca6e4..08bb2c28218 100644 --- a/paddle/fluid/operators/rank_loss_op.h +++ b/paddle/fluid/operators/rank_loss_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/read_op.cc b/paddle/fluid/operators/read_op.cc index 3ae454101f5..4d562c29191 100644 --- a/paddle/fluid/operators/read_op.cc +++ b/paddle/fluid/operators/read_op.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/framework/op_registry.h" -#include "paddle/framework/reader.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/reader.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/recurrent_op.cc b/paddle/fluid/operators/recurrent_op.cc index a136c5b447d..e4b9b8dab9b 100644 --- a/paddle/fluid/operators/recurrent_op.cc +++ b/paddle/fluid/operators/recurrent_op.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/executor.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/recv_op.cc b/paddle/fluid/operators/recv_op.cc index ba71094219f..c093f60ceed 100644 --- a/paddle/fluid/operators/recv_op.cc +++ b/paddle/fluid/operators/recv_op.cc @@ -14,13 +14,13 @@ limitations under the License. */ #include -#include "paddle/framework/data_type.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" #include -#include "paddle/operators/detail/grpc_client.h" +#include "paddle/fluid/operators/detail/grpc_client.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/reduce_op.cc b/paddle/fluid/operators/reduce_op.cc index 84f24a90959..f4d9d4cc07b 100644 --- a/paddle/fluid/operators/reduce_op.cc +++ b/paddle/fluid/operators/reduce_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/reduce_op.h" +#include "paddle/fluid/operators/reduce_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/reduce_op.cu b/paddle/fluid/operators/reduce_op.cu index 4ed1e051db4..1ca107ebfe9 100644 --- a/paddle/fluid/operators/reduce_op.cu +++ b/paddle/fluid/operators/reduce_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/reduce_op.h" +#include "paddle/fluid/operators/reduce_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/reduce_op.h b/paddle/fluid/operators/reduce_op.h index da5f3977769..a153cf272b5 100644 --- a/paddle/fluid/operators/reduce_op.h +++ b/paddle/fluid/operators/reduce_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include "glog/logging.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/reorder_lod_tensor_by_rank_op.cc b/paddle/fluid/operators/reorder_lod_tensor_by_rank_op.cc index 3c304479494..148a65bb4b7 100644 --- a/paddle/fluid/operators/reorder_lod_tensor_by_rank_op.cc +++ b/paddle/fluid/operators/reorder_lod_tensor_by_rank_op.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/detail/safe_ref.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/detail/safe_ref.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/reshape_op.cc b/paddle/fluid/operators/reshape_op.cc index b9743a5df10..b4f80cc06ab 100644 --- a/paddle/fluid/operators/reshape_op.cc +++ b/paddle/fluid/operators/reshape_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/reshape_op.h" +#include "paddle/fluid/operators/reshape_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/reshape_op.cu b/paddle/fluid/operators/reshape_op.cu index f487e43b99d..f9ae6da29e5 100644 --- a/paddle/fluid/operators/reshape_op.cu +++ b/paddle/fluid/operators/reshape_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/reshape_op.h" +#include "paddle/fluid/operators/reshape_op.h" REGISTER_OP_CUDA_KERNEL( reshape, diff --git a/paddle/fluid/operators/reshape_op.h b/paddle/fluid/operators/reshape_op.h index d884b03cadb..a17ba7c6194 100644 --- a/paddle/fluid/operators/reshape_op.h +++ b/paddle/fluid/operators/reshape_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/rmsprop_op.cc b/paddle/fluid/operators/rmsprop_op.cc index f7c250bf913..06d3ccafefd 100644 --- a/paddle/fluid/operators/rmsprop_op.cc +++ b/paddle/fluid/operators/rmsprop_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/rmsprop_op.h" +#include "paddle/fluid/operators/rmsprop_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/rmsprop_op.cu b/paddle/fluid/operators/rmsprop_op.cu index 0295dc262f0..a909c942791 100644 --- a/paddle/fluid/operators/rmsprop_op.cu +++ b/paddle/fluid/operators/rmsprop_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/rmsprop_op.h" +#include "paddle/fluid/operators/rmsprop_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/rmsprop_op.h b/paddle/fluid/operators/rmsprop_op.h index 16a561835d0..469c102a472 100644 --- a/paddle/fluid/operators/rmsprop_op.h +++ b/paddle/fluid/operators/rmsprop_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/rnn_memory_helper_op.cc b/paddle/fluid/operators/rnn_memory_helper_op.cc index eb55ed6a05b..504456c4b06 100644 --- a/paddle/fluid/operators/rnn_memory_helper_op.cc +++ b/paddle/fluid/operators/rnn_memory_helper_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/roi_pool_op.cc b/paddle/fluid/operators/roi_pool_op.cc index a7351f11c5d..09238f89a77 100644 --- a/paddle/fluid/operators/roi_pool_op.cc +++ b/paddle/fluid/operators/roi_pool_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/roi_pool_op.h" +#include "paddle/fluid/operators/roi_pool_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/roi_pool_op.cu b/paddle/fluid/operators/roi_pool_op.cu index a874befe4d1..0e8fc9ec7a6 100644 --- a/paddle/fluid/operators/roi_pool_op.cu +++ b/paddle/fluid/operators/roi_pool_op.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/roi_pool_op.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/roi_pool_op.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/roi_pool_op.h b/paddle/fluid/operators/roi_pool_op.h index 09a9d3d870c..15f3b36fcd1 100644 --- a/paddle/fluid/operators/roi_pool_op.h +++ b/paddle/fluid/operators/roi_pool_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/row_conv_op.cc b/paddle/fluid/operators/row_conv_op.cc index 68f4e353156..92661ea9716 100644 --- a/paddle/fluid/operators/row_conv_op.cc +++ b/paddle/fluid/operators/row_conv_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/row_conv_op.h" -#include "paddle/framework/eigen.h" +#include "paddle/fluid/operators/row_conv_op.h" +#include "paddle/fluid/framework/eigen.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/row_conv_op.cu b/paddle/fluid/operators/row_conv_op.cu index d1a6d119d3d..832072edf81 100644 --- a/paddle/fluid/operators/row_conv_op.cu +++ b/paddle/fluid/operators/row_conv_op.cu @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/row_conv_op.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/row_conv_op.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/row_conv_op.h b/paddle/fluid/operators/row_conv_op.h index 10d435ab080..59164b52159 100644 --- a/paddle/fluid/operators/row_conv_op.h +++ b/paddle/fluid/operators/row_conv_op.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/save_combine_op.cc b/paddle/fluid/operators/save_combine_op.cc index bffa2908bc4..c23de9073ef 100644 --- a/paddle/fluid/operators/save_combine_op.cc +++ b/paddle/fluid/operators/save_combine_op.cc @@ -17,11 +17,11 @@ limitations under the License. */ #include #include #include -#include "paddle/framework/data_type.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/save_load_combine_op_test.cc b/paddle/fluid/operators/save_load_combine_op_test.cc index f3ddc4a6c55..f8325bac6bc 100644 --- a/paddle/fluid/operators/save_load_combine_op_test.cc +++ b/paddle/fluid/operators/save_load_combine_op_test.cc @@ -16,7 +16,7 @@ limitations under the License. */ #include #include #include "gtest/gtest.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" USE_NO_KERNEL_OP(save_combine); USE_NO_KERNEL_OP(load_combine); diff --git a/paddle/fluid/operators/save_load_op_test.cc b/paddle/fluid/operators/save_load_op_test.cc index d829d5da174..da4573a8ed9 100644 --- a/paddle/fluid/operators/save_load_op_test.cc +++ b/paddle/fluid/operators/save_load_op_test.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "gtest/gtest.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" USE_NO_KERNEL_OP(save); USE_NO_KERNEL_OP(load); diff --git a/paddle/fluid/operators/save_op.cc b/paddle/fluid/operators/save_op.cc index 4b1cbe88836..483cdfa4c3b 100644 --- a/paddle/fluid/operators/save_op.cc +++ b/paddle/fluid/operators/save_op.cc @@ -17,11 +17,11 @@ limitations under the License. */ #include #include -#include "paddle/framework/data_type.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/scale_op.cc b/paddle/fluid/operators/scale_op.cc index c0e614743a8..017fc2c00e4 100644 --- a/paddle/fluid/operators/scale_op.cc +++ b/paddle/fluid/operators/scale_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/scale_op.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/operators/scale_op.h" +#include "paddle/fluid/operators/net_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/scale_op.cu b/paddle/fluid/operators/scale_op.cu index 7202c0de707..a9b46077aa0 100644 --- a/paddle/fluid/operators/scale_op.cu +++ b/paddle/fluid/operators/scale_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/scale_op.h" +#include "paddle/fluid/operators/scale_op.h" REGISTER_OP_CUDA_KERNEL( scale, diff --git a/paddle/fluid/operators/scale_op.h b/paddle/fluid/operators/scale_op.h index 395268c2eee..b1c2964ca63 100644 --- a/paddle/fluid/operators/scale_op.h +++ b/paddle/fluid/operators/scale_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/scatter.cu.h b/paddle/fluid/operators/scatter.cu.h index 55555300fc3..0f1b9426a74 100644 --- a/paddle/fluid/operators/scatter.cu.h +++ b/paddle/fluid/operators/scatter.cu.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/tensor.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/scatter.h b/paddle/fluid/operators/scatter.h index c1fb844ebd2..70cae1286ca 100644 --- a/paddle/fluid/operators/scatter.h +++ b/paddle/fluid/operators/scatter.h @@ -15,10 +15,10 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/ddim.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/scatter_op.cc b/paddle/fluid/operators/scatter_op.cc index b6533489063..e35930af534 100644 --- a/paddle/fluid/operators/scatter_op.cc +++ b/paddle/fluid/operators/scatter_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/scatter_op.h" -#include "paddle/framework/ddim.h" +#include "paddle/fluid/operators/scatter_op.h" +#include "paddle/fluid/framework/ddim.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/scatter_op.cu b/paddle/fluid/operators/scatter_op.cu index 0c198d22589..f9eaae33a80 100644 --- a/paddle/fluid/operators/scatter_op.cu +++ b/paddle/fluid/operators/scatter_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "gather.cu.h" -#include "paddle/operators/gather_op.h" +#include "paddle/fluid/operators/gather_op.h" #include "scatter.cu.h" namespace paddle { diff --git a/paddle/fluid/operators/scatter_op.h b/paddle/fluid/operators/scatter_op.h index 1a4f6f99bfe..65d10546328 100644 --- a/paddle/fluid/operators/scatter_op.h +++ b/paddle/fluid/operators/scatter_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once #include "gather.h" -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" #include "scatter.h" namespace paddle { diff --git a/paddle/fluid/operators/scatter_test.cc b/paddle/fluid/operators/scatter_test.cc index 00dbdacbfef..8fb5ef96af3 100644 --- a/paddle/fluid/operators/scatter_test.cc +++ b/paddle/fluid/operators/scatter_test.cc @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/scatter.h" -#include "paddle/framework/ddim.h" -#include "paddle/framework/tensor.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/operators/scatter.h" +#include "paddle/fluid/framework/ddim.h" +#include "paddle/fluid/framework/tensor.h" +#include "paddle/fluid/platform/place.h" #include #include diff --git a/paddle/fluid/operators/send_op.cc b/paddle/fluid/operators/send_op.cc index ee0f268b0e4..a8390aa6596 100644 --- a/paddle/fluid/operators/send_op.cc +++ b/paddle/fluid/operators/send_op.cc @@ -14,13 +14,13 @@ limitations under the License. */ #include -#include "paddle/framework/data_type.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/data_type.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/op_registry.h" #include -#include "paddle/operators/detail/grpc_client.h" +#include "paddle/fluid/operators/detail/grpc_client.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/send_recv_op_test.cc b/paddle/fluid/operators/send_recv_op_test.cc index 31527a906d5..716f687044a 100644 --- a/paddle/fluid/operators/send_recv_op_test.cc +++ b/paddle/fluid/operators/send_recv_op_test.cc @@ -17,11 +17,11 @@ limitations under the License. */ #include #include "gtest/gtest.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" -#include "paddle/framework/program_desc.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/selected_rows_functor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/framework/program_desc.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" #include "paddle/string/printf.h" USE_NO_KERNEL_OP(send); diff --git a/paddle/fluid/operators/sequence_concat_op.cc b/paddle/fluid/operators/sequence_concat_op.cc index 2f0aad2003e..4ddf800d85e 100644 --- a/paddle/fluid/operators/sequence_concat_op.cc +++ b/paddle/fluid/operators/sequence_concat_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_concat_op.h" +#include "paddle/fluid/operators/sequence_concat_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_concat_op.cu.cc b/paddle/fluid/operators/sequence_concat_op.cu.cc index 144bdb5af63..c5a280ef9e2 100644 --- a/paddle/fluid/operators/sequence_concat_op.cu.cc +++ b/paddle/fluid/operators/sequence_concat_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_concat_op.h" +#include "paddle/fluid/operators/sequence_concat_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sequence_concat_op.h b/paddle/fluid/operators/sequence_concat_op.h index 8445224f46a..9121196369f 100644 --- a/paddle/fluid/operators/sequence_concat_op.h +++ b/paddle/fluid/operators/sequence_concat_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/strided_memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_conv_op.cc b/paddle/fluid/operators/sequence_conv_op.cc index c5b7c81bd7c..af9938b1806 100644 --- a/paddle/fluid/operators/sequence_conv_op.cc +++ b/paddle/fluid/operators/sequence_conv_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_conv_op.h" +#include "paddle/fluid/operators/sequence_conv_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_conv_op.cu.cc b/paddle/fluid/operators/sequence_conv_op.cu.cc index 0b8f2c69556..36f9e8da95d 100644 --- a/paddle/fluid/operators/sequence_conv_op.cu.cc +++ b/paddle/fluid/operators/sequence_conv_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_conv_op.h" +#include "paddle/fluid/operators/sequence_conv_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sequence_conv_op.h b/paddle/fluid/operators/sequence_conv_op.h index bb584b7bfa5..1c81067fea2 100644 --- a/paddle/fluid/operators/sequence_conv_op.h +++ b/paddle/fluid/operators/sequence_conv_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/context_project.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/context_project.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_erase_op.cc b/paddle/fluid/operators/sequence_erase_op.cc index aa0c00aa6f7..2e0adf8b190 100644 --- a/paddle/fluid/operators/sequence_erase_op.cc +++ b/paddle/fluid/operators/sequence_erase_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_erase_op.h" +#include "paddle/fluid/operators/sequence_erase_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_erase_op.cu b/paddle/fluid/operators/sequence_erase_op.cu index 4a7217cfd65..43fc352fe78 100644 --- a/paddle/fluid/operators/sequence_erase_op.cu +++ b/paddle/fluid/operators/sequence_erase_op.cu @@ -14,8 +14,8 @@ limitations under the License. */ #include #include -#include "paddle/operators/sequence_erase_op.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/sequence_erase_op.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_erase_op.h b/paddle/fluid/operators/sequence_erase_op.h index cb2d7be009d..e151279c7fc 100644 --- a/paddle/fluid/operators/sequence_erase_op.h +++ b/paddle/fluid/operators/sequence_erase_op.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_expand_op.cc b/paddle/fluid/operators/sequence_expand_op.cc index d34dbd35b6d..4ebce641d28 100644 --- a/paddle/fluid/operators/sequence_expand_op.cc +++ b/paddle/fluid/operators/sequence_expand_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_expand_op.h" +#include "paddle/fluid/operators/sequence_expand_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_expand_op.cu b/paddle/fluid/operators/sequence_expand_op.cu index 0b9638b2ce6..5ac76d83da6 100644 --- a/paddle/fluid/operators/sequence_expand_op.cu +++ b/paddle/fluid/operators/sequence_expand_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/sequence_expand_op.h" +#include "paddle/fluid/operators/sequence_expand_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sequence_expand_op.h b/paddle/fluid/operators/sequence_expand_op.h index 6021526eee8..8010627ff6f 100644 --- a/paddle/fluid/operators/sequence_expand_op.h +++ b/paddle/fluid/operators/sequence_expand_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/memory/memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/memory/memcpy.h" #include "unsupported/Eigen/CXX11/Tensor" namespace paddle { diff --git a/paddle/fluid/operators/sequence_pool_op.cc b/paddle/fluid/operators/sequence_pool_op.cc index 549d9620ef2..2cfb336b2e0 100644 --- a/paddle/fluid/operators/sequence_pool_op.cc +++ b/paddle/fluid/operators/sequence_pool_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_pool_op.h" +#include "paddle/fluid/operators/sequence_pool_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_pool_op.cu b/paddle/fluid/operators/sequence_pool_op.cu index 265f6959352..364769c39bd 100644 --- a/paddle/fluid/operators/sequence_pool_op.cu +++ b/paddle/fluid/operators/sequence_pool_op.cu @@ -14,7 +14,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/sequence_pool_op.h" +#include "paddle/fluid/operators/sequence_pool_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sequence_pool_op.h b/paddle/fluid/operators/sequence_pool_op.h index 7519aa1d720..7b67e6201eb 100644 --- a/paddle/fluid/operators/sequence_pool_op.h +++ b/paddle/fluid/operators/sequence_pool_op.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/sequence_pooling.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence_pooling.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_reshape_op.cc b/paddle/fluid/operators/sequence_reshape_op.cc index d89a46a712c..c4e42d3eeb5 100644 --- a/paddle/fluid/operators/sequence_reshape_op.cc +++ b/paddle/fluid/operators/sequence_reshape_op.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/operators/sequence_reshape_op.h" -#include "paddle/framework/ddim.h" +#include "paddle/fluid/operators/sequence_reshape_op.h" +#include "paddle/fluid/framework/ddim.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_reshape_op.cu b/paddle/fluid/operators/sequence_reshape_op.cu index d9c2f7e9a41..5ca3497396e 100644 --- a/paddle/fluid/operators/sequence_reshape_op.cu +++ b/paddle/fluid/operators/sequence_reshape_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_reshape_op.h" +#include "paddle/fluid/operators/sequence_reshape_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sequence_reshape_op.h b/paddle/fluid/operators/sequence_reshape_op.h index aaae7ab2928..7a5d1261da9 100644 --- a/paddle/fluid/operators/sequence_reshape_op.h +++ b/paddle/fluid/operators/sequence_reshape_op.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_slice_op.cc b/paddle/fluid/operators/sequence_slice_op.cc index f79106ff0f7..87b8eff6462 100644 --- a/paddle/fluid/operators/sequence_slice_op.cc +++ b/paddle/fluid/operators/sequence_slice_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_slice_op.h" +#include "paddle/fluid/operators/sequence_slice_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_slice_op.cu b/paddle/fluid/operators/sequence_slice_op.cu index 43a21d619f4..041fabdf9a2 100755 --- a/paddle/fluid/operators/sequence_slice_op.cu +++ b/paddle/fluid/operators/sequence_slice_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_slice_op.h" +#include "paddle/fluid/operators/sequence_slice_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sequence_slice_op.h b/paddle/fluid/operators/sequence_slice_op.h index 0e4e4cf65fc..65c36a32aa1 100644 --- a/paddle/fluid/operators/sequence_slice_op.h +++ b/paddle/fluid/operators/sequence_slice_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/strided_memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_softmax_op.cc b/paddle/fluid/operators/sequence_softmax_op.cc index b74766f012e..f966b716207 100644 --- a/paddle/fluid/operators/sequence_softmax_op.cc +++ b/paddle/fluid/operators/sequence_softmax_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_softmax_op.h" +#include "paddle/fluid/operators/sequence_softmax_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sequence_softmax_op.cu.cc b/paddle/fluid/operators/sequence_softmax_op.cu.cc index 5f65b4daf97..c42dfd75409 100644 --- a/paddle/fluid/operators/sequence_softmax_op.cu.cc +++ b/paddle/fluid/operators/sequence_softmax_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sequence_softmax_op.h" +#include "paddle/fluid/operators/sequence_softmax_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sequence_softmax_op.h b/paddle/fluid/operators/sequence_softmax_op.h index e889e88cb34..e6c21c67b33 100644 --- a/paddle/fluid/operators/sequence_softmax_op.h +++ b/paddle/fluid/operators/sequence_softmax_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/softmax.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/softmax.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sgd_op.cc b/paddle/fluid/operators/sgd_op.cc index a11c9624ce5..f1e23a62f4e 100644 --- a/paddle/fluid/operators/sgd_op.cc +++ b/paddle/fluid/operators/sgd_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sgd_op.h" +#include "paddle/fluid/operators/sgd_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sgd_op.cu b/paddle/fluid/operators/sgd_op.cu index d27befe4460..09374e20494 100644 --- a/paddle/fluid/operators/sgd_op.cu +++ b/paddle/fluid/operators/sgd_op.cu @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/sgd_op.h" -#include "paddle/platform/cuda_helper.h" +#include "paddle/fluid/operators/sgd_op.h" +#include "paddle/fluid/platform/cuda_helper.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sgd_op.h b/paddle/fluid/operators/sgd_op.h index a6c544591e1..f1eaaecdb1e 100644 --- a/paddle/fluid/operators/sgd_op.h +++ b/paddle/fluid/operators/sgd_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/selected_rows.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/selected_rows.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/shrink_rnn_memory_op.cc b/paddle/fluid/operators/shrink_rnn_memory_op.cc index bf870115a4d..df50a324fde 100644 --- a/paddle/fluid/operators/shrink_rnn_memory_op.cc +++ b/paddle/fluid/operators/shrink_rnn_memory_op.cc @@ -11,10 +11,10 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/operators/array_operator.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/operators/array_operator.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cc b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cc index c526a88a127..3188415a2bd 100644 --- a/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cc +++ b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sigmoid_cross_entropy_with_logits_op.h" +#include "paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cu b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cu index 3f393265f48..daa9d3e4fa5 100644 --- a/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cu +++ b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/sigmoid_cross_entropy_with_logits_op.h" +#include "paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL(sigmoid_cross_entropy_with_logits, diff --git a/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h index b78bcc436e9..977849f7627 100644 --- a/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h +++ b/paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sign_op.cc b/paddle/fluid/operators/sign_op.cc index f63eaa4464c..54b962538b8 100644 --- a/paddle/fluid/operators/sign_op.cc +++ b/paddle/fluid/operators/sign_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sign_op.h" +#include "paddle/fluid/operators/sign_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sign_op.cu b/paddle/fluid/operators/sign_op.cu index f224880cffb..93cdb311eb4 100644 --- a/paddle/fluid/operators/sign_op.cu +++ b/paddle/fluid/operators/sign_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sign_op.h" +#include "paddle/fluid/operators/sign_op.h" REGISTER_OP_CUDA_KERNEL( sign, diff --git a/paddle/fluid/operators/sign_op.h b/paddle/fluid/operators/sign_op.h index 9fe49ae1a21..1c2ebebee40 100644 --- a/paddle/fluid/operators/sign_op.h +++ b/paddle/fluid/operators/sign_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/smooth_l1_loss_op.cc b/paddle/fluid/operators/smooth_l1_loss_op.cc index dcb18d729da..be4c7a56a84 100644 --- a/paddle/fluid/operators/smooth_l1_loss_op.cc +++ b/paddle/fluid/operators/smooth_l1_loss_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/smooth_l1_loss_op.h" +#include "paddle/fluid/operators/smooth_l1_loss_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/smooth_l1_loss_op.cu b/paddle/fluid/operators/smooth_l1_loss_op.cu index 213429bc370..94c0d6cd299 100644 --- a/paddle/fluid/operators/smooth_l1_loss_op.cu +++ b/paddle/fluid/operators/smooth_l1_loss_op.cu @@ -14,7 +14,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/smooth_l1_loss_op.h" +#include "paddle/fluid/operators/smooth_l1_loss_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/smooth_l1_loss_op.h b/paddle/fluid/operators/smooth_l1_loss_op.h index 3facfae116d..325ad824e18 100644 --- a/paddle/fluid/operators/smooth_l1_loss_op.h +++ b/paddle/fluid/operators/smooth_l1_loss_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/hostdevice.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/softmax_op.cc b/paddle/fluid/operators/softmax_op.cc index cef1f1fc99d..1d9462d08b9 100644 --- a/paddle/fluid/operators/softmax_op.cc +++ b/paddle/fluid/operators/softmax_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/softmax_op.h" +#include "paddle/fluid/operators/softmax_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/softmax_op.cu.cc b/paddle/fluid/operators/softmax_op.cu.cc index e7da40f3e82..c53d8a2bc82 100644 --- a/paddle/fluid/operators/softmax_op.cu.cc +++ b/paddle/fluid/operators/softmax_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/softmax_op.h" +#include "paddle/fluid/operators/softmax_op.h" namespace ops = paddle::operators; diff --git a/paddle/fluid/operators/softmax_op.h b/paddle/fluid/operators/softmax_op.h index 63e379a3b31..9287f023103 100644 --- a/paddle/fluid/operators/softmax_op.h +++ b/paddle/fluid/operators/softmax_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/softmax.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/softmax.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/softmax_with_cross_entropy_op.cc b/paddle/fluid/operators/softmax_with_cross_entropy_op.cc index 7135780c92d..79d56cb97d3 100644 --- a/paddle/fluid/operators/softmax_with_cross_entropy_op.cc +++ b/paddle/fluid/operators/softmax_with_cross_entropy_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/softmax_with_cross_entropy_op.h" +#include "paddle/fluid/operators/softmax_with_cross_entropy_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/softmax_with_cross_entropy_op.cu b/paddle/fluid/operators/softmax_with_cross_entropy_op.cu index 61583c6161c..410d9e8887c 100644 --- a/paddle/fluid/operators/softmax_with_cross_entropy_op.cu +++ b/paddle/fluid/operators/softmax_with_cross_entropy_op.cu @@ -14,7 +14,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/softmax_with_cross_entropy_op.h" +#include "paddle/fluid/operators/softmax_with_cross_entropy_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/softmax_with_cross_entropy_op.h b/paddle/fluid/operators/softmax_with_cross_entropy_op.h index 6bde0f37e06..0927efd42ce 100644 --- a/paddle/fluid/operators/softmax_with_cross_entropy_op.h +++ b/paddle/fluid/operators/softmax_with_cross_entropy_op.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/cross_entropy.h" -#include "paddle/operators/math/softmax.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/cross_entropy.h" +#include "paddle/fluid/operators/math/softmax.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/split_lod_tensor_op.cc b/paddle/fluid/operators/split_lod_tensor_op.cc index bd93c492015..f821dc54d7b 100644 --- a/paddle/fluid/operators/split_lod_tensor_op.cc +++ b/paddle/fluid/operators/split_lod_tensor_op.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/memory/memcpy.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/split_op.cc b/paddle/fluid/operators/split_op.cc index 8d55ae5dd7b..f8bc22fe1d3 100644 --- a/paddle/fluid/operators/split_op.cc +++ b/paddle/fluid/operators/split_op.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/split_op.h" -#include "paddle/operators/net_op.h" +#include "paddle/fluid/operators/split_op.h" +#include "paddle/fluid/operators/net_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/split_op.cu.cc b/paddle/fluid/operators/split_op.cu.cc index dbad0bbf68d..279691c759e 100644 --- a/paddle/fluid/operators/split_op.cu.cc +++ b/paddle/fluid/operators/split_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/split_op.h" +#include "paddle/fluid/operators/split_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( split, ops::SplitOpKernel); diff --git a/paddle/fluid/operators/split_op.h b/paddle/fluid/operators/split_op.h index a38c435d531..e78218f2fb1 100644 --- a/paddle/fluid/operators/split_op.h +++ b/paddle/fluid/operators/split_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/strided_memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/split_selected_rows_op.cc b/paddle/fluid/operators/split_selected_rows_op.cc index 0515ea13aad..113ce2ce109 100644 --- a/paddle/fluid/operators/split_selected_rows_op.cc +++ b/paddle/fluid/operators/split_selected_rows_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/split_selected_rows_op.h" +#include "paddle/fluid/operators/split_selected_rows_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/split_selected_rows_op.cu b/paddle/fluid/operators/split_selected_rows_op.cu index 983285480fd..0bbf1ecfaef 100644 --- a/paddle/fluid/operators/split_selected_rows_op.cu +++ b/paddle/fluid/operators/split_selected_rows_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/split_selected_rows_op.h" +#include "paddle/fluid/operators/split_selected_rows_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( split_selected_rows, diff --git a/paddle/fluid/operators/split_selected_rows_op.h b/paddle/fluid/operators/split_selected_rows_op.h index 12e64e2901e..527264bd675 100644 --- a/paddle/fluid/operators/split_selected_rows_op.h +++ b/paddle/fluid/operators/split_selected_rows_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/selected_rows_functor.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/spp_op.cc b/paddle/fluid/operators/spp_op.cc index c0aa87b0f06..e6755b12000 100644 --- a/paddle/fluid/operators/spp_op.cc +++ b/paddle/fluid/operators/spp_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/spp_op.h" +#include "paddle/fluid/operators/spp_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/spp_op.cu.cc b/paddle/fluid/operators/spp_op.cu.cc index 761e4d6c4a9..cad2ca5ef8e 100644 --- a/paddle/fluid/operators/spp_op.cu.cc +++ b/paddle/fluid/operators/spp_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/spp_op.h" +#include "paddle/fluid/operators/spp_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/spp_op.h b/paddle/fluid/operators/spp_op.h index f35b305d02c..1da1f805807 100644 --- a/paddle/fluid/operators/spp_op.h +++ b/paddle/fluid/operators/spp_op.h @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/pooling.h" -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/pooling.h" +#include "paddle/fluid/operators/strided_memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/squared_l2_distance_op.cc b/paddle/fluid/operators/squared_l2_distance_op.cc index 9e097176f34..c1d0c2c7f39 100644 --- a/paddle/fluid/operators/squared_l2_distance_op.cc +++ b/paddle/fluid/operators/squared_l2_distance_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/squared_l2_distance_op.h" +#include "paddle/fluid/operators/squared_l2_distance_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/squared_l2_distance_op.cu b/paddle/fluid/operators/squared_l2_distance_op.cu index f2648dde5eb..959e7afac99 100644 --- a/paddle/fluid/operators/squared_l2_distance_op.cu +++ b/paddle/fluid/operators/squared_l2_distance_op.cu @@ -14,7 +14,7 @@ limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/squared_l2_distance_op.h" +#include "paddle/fluid/operators/squared_l2_distance_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/squared_l2_distance_op.h b/paddle/fluid/operators/squared_l2_distance_op.h index 5bd5f4819a3..aab241247e5 100644 --- a/paddle/fluid/operators/squared_l2_distance_op.h +++ b/paddle/fluid/operators/squared_l2_distance_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/squared_l2_norm_op.cc b/paddle/fluid/operators/squared_l2_norm_op.cc index 6626bf03755..a43cc22994b 100644 --- a/paddle/fluid/operators/squared_l2_norm_op.cc +++ b/paddle/fluid/operators/squared_l2_norm_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/squared_l2_norm_op.h" +#include "paddle/fluid/operators/squared_l2_norm_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/squared_l2_norm_op.cu b/paddle/fluid/operators/squared_l2_norm_op.cu index b222113a8c8..52f4ab79b21 100644 --- a/paddle/fluid/operators/squared_l2_norm_op.cu +++ b/paddle/fluid/operators/squared_l2_norm_op.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/squared_l2_norm_op.h" +#include "paddle/fluid/operators/squared_l2_norm_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/squared_l2_norm_op.h b/paddle/fluid/operators/squared_l2_norm_op.h index 1ce26c775ed..56524636b8f 100644 --- a/paddle/fluid/operators/squared_l2_norm_op.h +++ b/paddle/fluid/operators/squared_l2_norm_op.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/strided_memcpy.h b/paddle/fluid/operators/strided_memcpy.h index 735cabcd973..8a99b405e26 100644 --- a/paddle/fluid/operators/strided_memcpy.h +++ b/paddle/fluid/operators/strided_memcpy.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/operators/detail/strided_memcpy.h" +#include "paddle/fluid/operators/detail/strided_memcpy.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/strided_memcpy_test.cc b/paddle/fluid/operators/strided_memcpy_test.cc index 06d81188558..a369941a993 100644 --- a/paddle/fluid/operators/strided_memcpy_test.cc +++ b/paddle/fluid/operators/strided_memcpy_test.cc @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/strided_memcpy.h" +#include "paddle/fluid/operators/strided_memcpy.h" #include "gtest/gtest.h" -#include "paddle/memory/memory.h" +#include "paddle/fluid/memory/memory.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sum_op.cc b/paddle/fluid/operators/sum_op.cc index 88ed67f7ba2..96f851720ae 100644 --- a/paddle/fluid/operators/sum_op.cc +++ b/paddle/fluid/operators/sum_op.cc @@ -9,10 +9,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/sum_op.h" +#include "paddle/fluid/operators/sum_op.h" #include -#include "paddle/framework/var_type_inference.h" -#include "paddle/operators/detail/safe_ref.h" +#include "paddle/fluid/framework/var_type_inference.h" +#include "paddle/fluid/operators/detail/safe_ref.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/sum_op.cu b/paddle/fluid/operators/sum_op.cu index 873155076c1..8d8f90d7510 100644 --- a/paddle/fluid/operators/sum_op.cu +++ b/paddle/fluid/operators/sum_op.cu @@ -10,7 +10,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #define EIGEN_USE_GPU -#include "paddle/operators/sum_op.h" +#include "paddle/fluid/operators/sum_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/sum_op.h b/paddle/fluid/operators/sum_op.h index 3d8102c3ae2..5e1222c6ef7 100644 --- a/paddle/fluid/operators/sum_op.h +++ b/paddle/fluid/operators/sum_op.h @@ -10,11 +10,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/eigen.h" -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/selected_rows_functor.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/selected_rows_functor.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/target_assign_op.cc b/paddle/fluid/operators/target_assign_op.cc index 615ca857ceb..24f1b725231 100644 --- a/paddle/fluid/operators/target_assign_op.cc +++ b/paddle/fluid/operators/target_assign_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/target_assign_op.h" +#include "paddle/fluid/operators/target_assign_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/target_assign_op.cu b/paddle/fluid/operators/target_assign_op.cu index fc0a1000a42..5c012d27ad8 100644 --- a/paddle/fluid/operators/target_assign_op.cu +++ b/paddle/fluid/operators/target_assign_op.cu @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/target_assign_op.h" +#include "paddle/fluid/operators/target_assign_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/target_assign_op.h b/paddle/fluid/operators/target_assign_op.h index 574919e1ef8..876111523af 100644 --- a/paddle/fluid/operators/target_assign_op.h +++ b/paddle/fluid/operators/target_assign_op.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/platform/assert.h" -#include "paddle/platform/for_range.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/assert.h" +#include "paddle/fluid/platform/for_range.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/tensor_array_read_write_op.cc b/paddle/fluid/operators/tensor_array_read_write_op.cc index a70be8b8752..50811fb2249 100644 --- a/paddle/fluid/operators/tensor_array_read_write_op.cc +++ b/paddle/fluid/operators/tensor_array_read_write_op.cc @@ -11,8 +11,8 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/array_operator.h" -#include "paddle/operators/detail/safe_ref.h" +#include "paddle/fluid/operators/array_operator.h" +#include "paddle/fluid/operators/detail/safe_ref.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/top_k_op.cc b/paddle/fluid/operators/top_k_op.cc index a8ddd729732..c81ea860d0c 100644 --- a/paddle/fluid/operators/top_k_op.cc +++ b/paddle/fluid/operators/top_k_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/top_k_op.h" +#include "paddle/fluid/operators/top_k_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/top_k_op.cu b/paddle/fluid/operators/top_k_op.cu index f7bf58e7218..5390cb5063b 100644 --- a/paddle/fluid/operators/top_k_op.cu +++ b/paddle/fluid/operators/top_k_op.cu @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/platform/assert.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/assert.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/top_k_op.h b/paddle/fluid/operators/top_k_op.h index bf42e15e6b2..e32b3515007 100644 --- a/paddle/fluid/operators/top_k_op.h +++ b/paddle/fluid/operators/top_k_op.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include #include -#include "paddle/framework/eigen.h" -#include "paddle/framework/op_registry.h" +#include "paddle/fluid/framework/eigen.h" +#include "paddle/fluid/framework/op_registry.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/transpose_op.cc b/paddle/fluid/operators/transpose_op.cc index c7ae162638c..a3d8acffc26 100644 --- a/paddle/fluid/operators/transpose_op.cc +++ b/paddle/fluid/operators/transpose_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/transpose_op.h" +#include "paddle/fluid/operators/transpose_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/transpose_op.cu.cc b/paddle/fluid/operators/transpose_op.cu.cc index 281c4468cc2..f8667ab369e 100644 --- a/paddle/fluid/operators/transpose_op.cu.cc +++ b/paddle/fluid/operators/transpose_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/transpose_op.h" +#include "paddle/fluid/operators/transpose_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/transpose_op.h b/paddle/fluid/operators/transpose_op.h index b9686a2db3f..1fb419474ab 100644 --- a/paddle/fluid/operators/transpose_op.h +++ b/paddle/fluid/operators/transpose_op.h @@ -14,8 +14,8 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/uniform_random_op.cc b/paddle/fluid/operators/uniform_random_op.cc index 3a314bdb9b0..b6fea1d4485 100644 --- a/paddle/fluid/operators/uniform_random_op.cc +++ b/paddle/fluid/operators/uniform_random_op.cc @@ -11,8 +11,8 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/uniform_random_op.cu b/paddle/fluid/operators/uniform_random_op.cu index 719d0872a7c..9afca68e59f 100644 --- a/paddle/fluid/operators/uniform_random_op.cu +++ b/paddle/fluid/operators/uniform_random_op.cu @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #include #include -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/unpool_op.cc b/paddle/fluid/operators/unpool_op.cc index 50cee11a7a2..2e0b271fed6 100644 --- a/paddle/fluid/operators/unpool_op.cc +++ b/paddle/fluid/operators/unpool_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/unpool_op.h" +#include "paddle/fluid/operators/unpool_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/unpool_op.cu.cc b/paddle/fluid/operators/unpool_op.cu.cc index 9b002e35c43..15d81eb296b 100644 --- a/paddle/fluid/operators/unpool_op.cu.cc +++ b/paddle/fluid/operators/unpool_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/unpool_op.h" +#include "paddle/fluid/operators/unpool_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/unpool_op.h b/paddle/fluid/operators/unpool_op.h index ee18b118c95..ceed5507391 100644 --- a/paddle/fluid/operators/unpool_op.h +++ b/paddle/fluid/operators/unpool_op.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/unpooling.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/unpooling.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/warpctc_op.cc b/paddle/fluid/operators/warpctc_op.cc index bd0c5f99576..1c05fed0b47 100644 --- a/paddle/fluid/operators/warpctc_op.cc +++ b/paddle/fluid/operators/warpctc_op.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/warpctc_op.h" +#include "paddle/fluid/operators/warpctc_op.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/warpctc_op.cu.cc b/paddle/fluid/operators/warpctc_op.cu.cc index 7d8527ac75f..9ee7f970a9a 100644 --- a/paddle/fluid/operators/warpctc_op.cu.cc +++ b/paddle/fluid/operators/warpctc_op.cu.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/operators/warpctc_op.h" +#include "paddle/fluid/operators/warpctc_op.h" namespace ops = paddle::operators; REGISTER_OP_CUDA_KERNEL( diff --git a/paddle/fluid/operators/warpctc_op.h b/paddle/fluid/operators/warpctc_op.h index 8aea061c00c..a1de71627ee 100644 --- a/paddle/fluid/operators/warpctc_op.h +++ b/paddle/fluid/operators/warpctc_op.h @@ -14,11 +14,11 @@ limitations under the License. */ #pragma once -#include "paddle/framework/op_registry.h" -#include "paddle/operators/math/math_function.h" -#include "paddle/operators/math/sequence_padding.h" -#include "paddle/operators/math/sequence_scale.h" -#include "paddle/platform/dynload/warpctc.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/operators/math/math_function.h" +#include "paddle/fluid/operators/math/sequence_padding.h" +#include "paddle/fluid/operators/math/sequence_scale.h" +#include "paddle/fluid/platform/dynload/warpctc.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/while_op.cc b/paddle/fluid/operators/while_op.cc index a744ebd6159..d254c572acf 100644 --- a/paddle/fluid/operators/while_op.cc +++ b/paddle/fluid/operators/while_op.cc @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/framework/executor.h" -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/op_registry.h" -#include "paddle/framework/operator.h" -#include "paddle/operators/detail/safe_ref.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/operator.h" +#include "paddle/fluid/operators/detail/safe_ref.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/platform/cpu_info.cc b/paddle/fluid/platform/cpu_info.cc index 78e1fa9df56..47473aead0e 100644 --- a/paddle/fluid/platform/cpu_info.cc +++ b/paddle/fluid/platform/cpu_info.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/cpu_info.h" +#include "paddle/fluid/platform/cpu_info.h" #ifdef __APPLE__ #include diff --git a/paddle/fluid/platform/cpu_info_test.cc b/paddle/fluid/platform/cpu_info_test.cc index 1bfe62c1fb6..d1fdba13b80 100644 --- a/paddle/fluid/platform/cpu_info_test.cc +++ b/paddle/fluid/platform/cpu_info_test.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/platform/cpu_info.h" +#include "paddle/fluid/platform/cpu_info.h" #include "paddle/string/printf.h" #include diff --git a/paddle/fluid/platform/cudnn_helper.h b/paddle/fluid/platform/cudnn_helper.h index 80a4c9bb4bb..f2daa4f4fcc 100644 --- a/paddle/fluid/platform/cudnn_helper.h +++ b/paddle/fluid/platform/cudnn_helper.h @@ -15,9 +15,9 @@ limitations under the License. */ #pragma once #include -#include "paddle/platform/dynload/cudnn.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/macros.h" +#include "paddle/fluid/platform/dynload/cudnn.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/macros.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/cudnn_helper_test.cc b/paddle/fluid/platform/cudnn_helper_test.cc index 427359f6971..cd0bd3fe3ed 100644 --- a/paddle/fluid/platform/cudnn_helper_test.cc +++ b/paddle/fluid/platform/cudnn_helper_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/cudnn_helper.h" +#include "paddle/fluid/platform/cudnn_helper.h" #include TEST(CudnnHelper, ScopedTensorDescriptor) { diff --git a/paddle/fluid/platform/device_context.cc b/paddle/fluid/platform/device_context.cc index 9d9348079a0..c4da846bb1c 100644 --- a/paddle/fluid/platform/device_context.cc +++ b/paddle/fluid/platform/device_context.cc @@ -9,8 +9,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/device_context.h" -#include "paddle/memory/memory.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/memory/memory.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/device_context.h b/paddle/fluid/platform/device_context.h index 9826a642768..10b581f41a1 100644 --- a/paddle/fluid/platform/device_context.h +++ b/paddle/fluid/platform/device_context.h @@ -15,18 +15,18 @@ limitations under the License. */ #include #ifdef PADDLE_WITH_CUDA -#include "paddle/platform/dynload/cublas.h" -#include "paddle/platform/dynload/cudnn.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/platform/dynload/cublas.h" +#include "paddle/fluid/platform/dynload/cudnn.h" +#include "paddle/fluid/platform/gpu_info.h" #define EIGEN_USE_GPU #endif #ifdef PADDLE_WITH_MKLDNN -#include "paddle/platform/mkldnn_helper.h" +#include "paddle/fluid/platform/mkldnn_helper.h" #endif -#include "paddle/platform/enforce.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/place.h" #include "unsupported/Eigen/CXX11/Tensor" #include "glog/logging.h" diff --git a/paddle/fluid/platform/device_context_test.cu b/paddle/fluid/platform/device_context_test.cu index 767fe9b24a5..f4dae6e90a8 100644 --- a/paddle/fluid/platform/device_context_test.cu +++ b/paddle/fluid/platform/device_context_test.cu @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "gtest/gtest.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/platform/device_context.h" #include "glog/logging.h" diff --git a/paddle/fluid/platform/dynload/cublas.cc b/paddle/fluid/platform/dynload/cublas.cc index 6aca716657c..c599712554b 100644 --- a/paddle/fluid/platform/dynload/cublas.cc +++ b/paddle/fluid/platform/dynload/cublas.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/dynload/cublas.h" +#include "paddle/fluid/platform/dynload/cublas.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/cublas.h b/paddle/fluid/platform/dynload/cublas.h index 61a22d9db3e..05f69e50651 100644 --- a/paddle/fluid/platform/dynload/cublas.h +++ b/paddle/fluid/platform/dynload/cublas.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include #include -#include "paddle/platform/dynload/dynamic_loader.h" +#include "paddle/fluid/platform/dynload/dynamic_loader.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/cudnn.cc b/paddle/fluid/platform/dynload/cudnn.cc index 701f6240fef..0b1c4c4f960 100644 --- a/paddle/fluid/platform/dynload/cudnn.cc +++ b/paddle/fluid/platform/dynload/cudnn.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/dynload/cudnn.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/dynload/cudnn.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/cudnn.h b/paddle/fluid/platform/dynload/cudnn.h index b9263479494..00dfbc83872 100644 --- a/paddle/fluid/platform/dynload/cudnn.h +++ b/paddle/fluid/platform/dynload/cudnn.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include #include -#include "paddle/platform/dynload/dynamic_loader.h" +#include "paddle/fluid/platform/dynload/dynamic_loader.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/curand.cc b/paddle/fluid/platform/dynload/curand.cc index d05dd88126b..eac690b1458 100644 --- a/paddle/fluid/platform/dynload/curand.cc +++ b/paddle/fluid/platform/dynload/curand.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include +#include "paddle/fluid/platform/dynload/curand.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/curand.h b/paddle/fluid/platform/dynload/curand.h index 7bfe0778c78..ce3115b3ce0 100644 --- a/paddle/fluid/platform/dynload/curand.h +++ b/paddle/fluid/platform/dynload/curand.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include #include -#include "paddle/platform/dynload/dynamic_loader.h" +#include "paddle/fluid/platform/dynload/dynamic_loader.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/dynamic_loader.cc b/paddle/fluid/platform/dynload/dynamic_loader.cc index c8c09ae608f..eb00f93b7cd 100644 --- a/paddle/fluid/platform/dynload/dynamic_loader.cc +++ b/paddle/fluid/platform/dynload/dynamic_loader.cc @@ -12,14 +12,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/dynload/dynamic_loader.h" +#include "paddle/fluid/platform/dynload/dynamic_loader.h" #include #include #include #include #include "gflags/gflags.h" #include "glog/logging.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" DEFINE_string(cudnn_dir, "", "Specify path for loading libcudnn.so. For instance, " diff --git a/paddle/fluid/platform/dynload/nccl.cc b/paddle/fluid/platform/dynload/nccl.cc index 4cec829a8ad..1dc3e96f04a 100644 --- a/paddle/fluid/platform/dynload/nccl.cc +++ b/paddle/fluid/platform/dynload/nccl.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/dynload/nccl.h" +#include "paddle/fluid/platform/dynload/nccl.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/nccl.h b/paddle/fluid/platform/dynload/nccl.h index 6c776afc97a..349a4d0ba32 100644 --- a/paddle/fluid/platform/dynload/nccl.h +++ b/paddle/fluid/platform/dynload/nccl.h @@ -17,8 +17,8 @@ limitations under the License. */ #include #include #include -#include "paddle/platform/call_once.h" -#include "paddle/platform/dynload/dynamic_loader.h" +#include "paddle/fluid/platform/call_once.h" +#include "paddle/fluid/platform/dynload/dynamic_loader.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/warpctc.cc b/paddle/fluid/platform/dynload/warpctc.cc index 9b7d01a6e8f..84de2cae947 100644 --- a/paddle/fluid/platform/dynload/warpctc.cc +++ b/paddle/fluid/platform/dynload/warpctc.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/dynload/warpctc.h" +#include "paddle/fluid/platform/dynload/warpctc.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/dynload/warpctc.h b/paddle/fluid/platform/dynload/warpctc.h index acafcaff2cc..f1955818ded 100644 --- a/paddle/fluid/platform/dynload/warpctc.h +++ b/paddle/fluid/platform/dynload/warpctc.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include #include "ctc.h" -#include "paddle/platform/dynload/dynamic_loader.h" +#include "paddle/fluid/platform/dynload/dynamic_loader.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/enforce.cc b/paddle/fluid/platform/enforce.cc index e8d31bc782e..55cd80943cf 100644 --- a/paddle/fluid/platform/enforce.cc +++ b/paddle/fluid/platform/enforce.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" namespace paddle { namespace platform {} // namespace platform diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index d1c7be0790b..b22893c0a56 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -22,7 +22,7 @@ limitations under the License. */ #include #include -#include "paddle/platform/macros.h" +#include "paddle/fluid/platform/macros.h" #include "paddle/string/printf.h" #include "paddle/string/to_string.h" @@ -34,10 +34,10 @@ limitations under the License. */ #ifdef PADDLE_WITH_CUDA -#include "paddle/platform/dynload/cublas.h" -#include "paddle/platform/dynload/cudnn.h" -#include "paddle/platform/dynload/curand.h" -#include "paddle/platform/dynload/nccl.h" +#include "paddle/fluid/platform/dynload/cublas.h" +#include "paddle/fluid/platform/dynload/cudnn.h" +#include "paddle/fluid/platform/dynload/curand.h" +#include "paddle/fluid/platform/dynload/nccl.h" #include #include diff --git a/paddle/fluid/platform/enforce_test.cc b/paddle/fluid/platform/enforce_test.cc index 8206a055eab..896a9a04eca 100644 --- a/paddle/fluid/platform/enforce_test.cc +++ b/paddle/fluid/platform/enforce_test.cc @@ -14,7 +14,7 @@ limitations under the License. */ #include #include "gtest/gtest.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" #include "paddle/string/piece.h" using StringPiece = paddle::string::Piece; diff --git a/paddle/fluid/platform/for_range.h b/paddle/fluid/platform/for_range.h index 694a66d9ac4..0e695328c39 100644 --- a/paddle/fluid/platform/for_range.h +++ b/paddle/fluid/platform/for_range.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "paddle/platform/device_context.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/gpu_info.cc b/paddle/fluid/platform/gpu_info.cc index 7037551d754..1797f59a9c9 100644 --- a/paddle/fluid/platform/gpu_info.cc +++ b/paddle/fluid/platform/gpu_info.cc @@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/platform/gpu_info.h" #include "gflags/gflags.h" -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" DEFINE_double(fraction_of_gpu_memory_to_use, 0.92, "Default use 92% of GPU memory for PaddlePaddle," diff --git a/paddle/fluid/platform/nccl_test.cu b/paddle/fluid/platform/nccl_test.cu index 84f5ac28be3..75b95aff1a4 100644 --- a/paddle/fluid/platform/nccl_test.cu +++ b/paddle/fluid/platform/nccl_test.cu @@ -19,11 +19,11 @@ limitations under the License. */ #include "glog/logging.h" #include "gtest/gtest.h" -#include "paddle/framework/init.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/dynload/nccl.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/dynload/nccl.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/gpu_info.h" static int dev_count = 0; diff --git a/paddle/fluid/platform/place.cc b/paddle/fluid/platform/place.cc index f05260ccac4..e99b75d761a 100644 --- a/paddle/fluid/platform/place.cc +++ b/paddle/fluid/platform/place.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/place.h" +#include "paddle/fluid/platform/place.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/place.h b/paddle/fluid/platform/place.h index fbb43fa043a..2977a41036e 100644 --- a/paddle/fluid/platform/place.h +++ b/paddle/fluid/platform/place.h @@ -15,8 +15,8 @@ limitations under the License. */ #pragma once #include -#include "paddle/platform/enforce.h" -#include "paddle/platform/variant.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/variant.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/place_test.cc b/paddle/fluid/platform/place_test.cc index 150b2d3b1fb..f248902d91c 100644 --- a/paddle/fluid/platform/place_test.cc +++ b/paddle/fluid/platform/place_test.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/platform/place.h" +#include "paddle/fluid/platform/place.h" #include #include "gtest/gtest.h" diff --git a/paddle/fluid/platform/profiler.cc b/paddle/fluid/platform/profiler.cc index 6df087d154c..28d2675f799 100644 --- a/paddle/fluid/platform/profiler.cc +++ b/paddle/fluid/platform/profiler.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/profiler.h" +#include "paddle/fluid/platform/profiler.h" #include #include #include "glog/logging.h" diff --git a/paddle/fluid/platform/profiler.h b/paddle/fluid/platform/profiler.h index 8de1e6ad296..0bc5e666cb4 100644 --- a/paddle/fluid/platform/profiler.h +++ b/paddle/fluid/platform/profiler.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include #include -#include "paddle/platform/device_context.h" +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/profiler_test.cc b/paddle/fluid/platform/profiler_test.cc index 81f10c91342..d2525c38b6f 100644 --- a/paddle/fluid/platform/profiler_test.cc +++ b/paddle/fluid/platform/profiler_test.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/platform/profiler.h" +#include "paddle/fluid/platform/profiler.h" #include "gtest/gtest.h" TEST(Event, CpuElapsedTime) { diff --git a/paddle/fluid/platform/transform.h b/paddle/fluid/platform/transform.h index a88902b164c..879daed1910 100644 --- a/paddle/fluid/platform/transform.h +++ b/paddle/fluid/platform/transform.h @@ -14,17 +14,17 @@ limitations under the License. */ #pragma once -#include "paddle/platform/device_context.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/hostdevice.h" -#include "paddle/platform/place.h" +#include "paddle/fluid/platform/device_context.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/hostdevice.h" +#include "paddle/fluid/platform/place.h" #include #include #ifdef __NVCC__ #include #include -#include "paddle/platform/details/device_ptr_cast.h" +#include "paddle/fluid/platform/details/device_ptr_cast.h" #endif namespace paddle { diff --git a/paddle/fluid/platform/transform_test.cu b/paddle/fluid/platform/transform_test.cu index af9204a0a7b..0e4b9edc2fd 100644 --- a/paddle/fluid/platform/transform_test.cu +++ b/paddle/fluid/platform/transform_test.cu @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #include -#include "paddle/memory/memcpy.h" -#include "paddle/memory/memory.h" -#include "paddle/platform/hostdevice.h" -#include "paddle/platform/transform.h" +#include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/memory/memory.h" +#include "paddle/fluid/platform/hostdevice.h" +#include "paddle/fluid/platform/transform.h" template class Scale { diff --git a/paddle/fluid/pybind/.clang-format b/paddle/fluid/pybind/.clang-format deleted file mode 120000 index 7d28cb39247..00000000000 --- a/paddle/fluid/pybind/.clang-format +++ /dev/null @@ -1 +0,0 @@ -../framework/.clang-format \ No newline at end of file diff --git a/paddle/fluid/pybind/.clang-format b/paddle/fluid/pybind/.clang-format new file mode 100644 index 00000000000..29282dc87e2 --- /dev/null +++ b/paddle/fluid/pybind/.clang-format @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: Google +Standard: Cpp11 +... diff --git a/paddle/fluid/pybind/const_value.cc b/paddle/fluid/pybind/const_value.cc index b13ad42ea29..098252a83d3 100644 --- a/paddle/fluid/pybind/const_value.cc +++ b/paddle/fluid/pybind/const_value.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "const_value.h" -#include "paddle/framework/operator.h" +#include "paddle/fluid/framework/operator.h" namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/const_value.h b/paddle/fluid/pybind/const_value.h index 3d57c972a9d..67d14ac9ff0 100644 --- a/paddle/fluid/pybind/const_value.h +++ b/paddle/fluid/pybind/const_value.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once #include -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" #include "pybind11/pybind11.h" namespace py = pybind11; diff --git a/paddle/fluid/pybind/exception.cc b/paddle/fluid/pybind/exception.cc index e29ac3ebab7..7398a88541b 100644 --- a/paddle/fluid/pybind/exception.cc +++ b/paddle/fluid/pybind/exception.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/pybind/exception.h" +#include "paddle/fluid/pybind/exception.h" namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/exception.h b/paddle/fluid/pybind/exception.h index 436ddd5707a..43e91a70630 100644 --- a/paddle/fluid/pybind/exception.h +++ b/paddle/fluid/pybind/exception.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once #include -#include "paddle/platform/enforce.h" +#include "paddle/fluid/platform/enforce.h" #include "pybind11/pybind11.h" namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/protobuf.cc b/paddle/fluid/pybind/protobuf.cc index 0a92e10927c..4aefcf1a1cd 100644 --- a/paddle/fluid/pybind/protobuf.cc +++ b/paddle/fluid/pybind/protobuf.cc @@ -12,14 +12,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/pybind/protobuf.h" +#include "paddle/fluid/pybind/protobuf.h" #include #include -#include "paddle/framework/backward.h" -#include "paddle/framework/block_desc.h" -#include "paddle/framework/op_desc.h" -#include "paddle/framework/program_desc.h" -#include "paddle/framework/var_desc.h" +#include "paddle/fluid/framework/backward.h" +#include "paddle/fluid/framework/block_desc.h" +#include "paddle/fluid/framework/op_desc.h" +#include "paddle/fluid/framework/program_desc.h" +#include "paddle/fluid/framework/var_desc.h" // Cast boost::variant for PyBind. // Copy from diff --git a/paddle/fluid/pybind/protobuf.h b/paddle/fluid/pybind/protobuf.h index 9e747e9ea60..c828e4583d2 100644 --- a/paddle/fluid/pybind/protobuf.h +++ b/paddle/fluid/pybind/protobuf.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #include #include -#include "paddle/platform/variant.h" +#include "paddle/fluid/platform/variant.h" #include "pybind11/numpy.h" #include "pybind11/pybind11.h" #include "pybind11/stl.h" diff --git a/paddle/fluid/pybind/pybind.cc b/paddle/fluid/pybind/pybind.cc index a880d9bdbc6..8924aabd17b 100644 --- a/paddle/fluid/pybind/pybind.cc +++ b/paddle/fluid/pybind/pybind.cc @@ -12,35 +12,35 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/pybind/protobuf.h" +#include "paddle/fluid/pybind/protobuf.h" #include // for call_once #include -#include "paddle/framework/backward.h" -#include "paddle/framework/executor.h" -#include "paddle/framework/feed_fetch_method.h" -#include "paddle/framework/framework.pb.h" -#include "paddle/framework/init.h" -#include "paddle/framework/lod_rank_table.h" -#include "paddle/framework/lod_tensor.h" -#include "paddle/framework/lod_tensor_array.h" -#include "paddle/framework/prune.h" -#include "paddle/framework/selected_rows.h" -#include "paddle/operators/cond_op.h" -#include "paddle/operators/net_op.h" -#include "paddle/platform/enforce.h" -#include "paddle/platform/place.h" -#include "paddle/platform/profiler.h" -#include "paddle/pybind/const_value.h" -#include "paddle/pybind/exception.h" -#include "paddle/pybind/pybind.h" -#include "paddle/pybind/tensor_py.h" +#include "paddle/fluid/framework/backward.h" +#include "paddle/fluid/framework/executor.h" +#include "paddle/fluid/framework/feed_fetch_method.h" +#include "paddle/fluid/framework/framework.pb.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/framework/lod_rank_table.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/framework/lod_tensor_array.h" +#include "paddle/fluid/framework/prune.h" +#include "paddle/fluid/framework/selected_rows.h" +#include "paddle/fluid/operators/cond_op.h" +#include "paddle/fluid/operators/net_op.h" +#include "paddle/fluid/platform/enforce.h" +#include "paddle/fluid/platform/place.h" +#include "paddle/fluid/platform/profiler.h" +#include "paddle/fluid/pybind/const_value.h" +#include "paddle/fluid/pybind/exception.h" +#include "paddle/fluid/pybind/pybind.h" +#include "paddle/fluid/pybind/tensor_py.h" #include "paddle/string/to_string.h" #ifdef PADDLE_WITH_CUDA -#include "paddle/operators/nccl/nccl_gpu_common.h" -#include "paddle/platform/cuda_profiler.h" -#include "paddle/platform/gpu_info.h" +#include "paddle/fluid/operators/nccl/nccl_gpu_common.h" +#include "paddle/fluid/platform/cuda_profiler.h" +#include "paddle/fluid/platform/gpu_info.h" #endif // disable auto conversion to list in Python diff --git a/paddle/fluid/pybind/tensor_py.h b/paddle/fluid/pybind/tensor_py.h index 3b5210e2b91..0261709f1e4 100644 --- a/paddle/fluid/pybind/tensor_py.h +++ b/paddle/fluid/pybind/tensor_py.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once #include -#include "paddle/framework/lod_tensor.h" -#include "paddle/memory/memcpy.h" -#include "paddle/platform/device_context.h" +#include "paddle/fluid/framework/lod_tensor.h" +#include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/platform/device_context.h" #include "pybind11/numpy.h" #include "pybind11/pybind11.h" diff --git a/paddle/math/float16.h b/paddle/math/float16.h index efebbce5040..63248d36f9d 100644 --- a/paddle/math/float16.h +++ b/paddle/math/float16.h @@ -22,7 +22,7 @@ limitations under the License. */ #include "unsupported/Eigen/CXX11/Tensor" -#include "paddle/platform/hostdevice.h" +#include "paddle/fluid/platform/hostdevice.h" #ifdef __GNUC__ #define PADDLE_GNUC_VER (__GNUC__ * 10 + __GNUC_MINOR__) diff --git a/paddle/testing/paddle_gtest_main.cc b/paddle/testing/paddle_gtest_main.cc index ab84f1c292b..270f2f4c181 100644 --- a/paddle/testing/paddle_gtest_main.cc +++ b/paddle/testing/paddle_gtest_main.cc @@ -16,8 +16,8 @@ limitations under the License. */ #include "gflags/gflags.h" #include "gtest/gtest.h" -#include "paddle/framework/init.h" -#include "paddle/memory/memory.h" +#include "paddle/fluid/framework/init.h" +#include "paddle/fluid/memory/memory.h" int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); -- GitLab From e0fcaa518f4d15b895777e233c56acc4298a9c65 Mon Sep 17 00:00:00 2001 From: kavyasrinet Date: Fri, 9 Feb 2018 17:25:58 -0800 Subject: [PATCH 46/55] Added an elementary unit test for CSP (#8340) * Added an elementary test case for CSP * removed input * Rename test file to avoid running in CI * Fix YAPF error * Remove one line function handler --- python/paddle/v2/fluid/tests/notest_csp.py | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 python/paddle/v2/fluid/tests/notest_csp.py diff --git a/python/paddle/v2/fluid/tests/notest_csp.py b/python/paddle/v2/fluid/tests/notest_csp.py new file mode 100644 index 00000000000..7fe234a20b5 --- /dev/null +++ b/python/paddle/v2/fluid/tests/notest_csp.py @@ -0,0 +1,37 @@ +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest +import paddle.v2.fluid as fluid + + +class TestCSPFramework(unittest.TestCase): + def daisy_chain(self): + n = 10000 + leftmost = fluid.make_channel(dtype=int) + right = leftmost + left = leftmost + with fluid.While(steps=n): + right = fluid.make_channel(dtype=int) + with fluid.go(): + fluid.send(left, 1 + fluid.recv(right)) + left = right + + with fluid.go(): + fluid.send(right, 1) + fluid.Print(fluid.recv(leftmost)) + + +if __name__ == '__main__': + unittest.main() -- GitLab From 154368b1a0f81dda8393a9aa8687d7da44b3bead Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 9 Feb 2018 17:34:15 -0800 Subject: [PATCH 47/55] Re-add the lack pybind.h --- paddle/fluid/pybind/pybind.h | 158 +++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 paddle/fluid/pybind/pybind.h diff --git a/paddle/fluid/pybind/pybind.h b/paddle/fluid/pybind/pybind.h new file mode 100644 index 00000000000..b3ea649a5b0 --- /dev/null +++ b/paddle/fluid/pybind/pybind.h @@ -0,0 +1,158 @@ +// Generated by the paddle/operator/CMakeLists.txt. DO NOT EDIT! + +USE_CUDA_ONLY_OP(ncclAllReduce); +USE_NO_KERNEL_OP(cond); +USE_OP(cross_entropy); +USE_OP(softmax_with_cross_entropy); +USE_OP(softmax); +USE_OP(detection_output); +USE_OP(sequence_softmax); +USE_OP(sum); +USE_OP(sgd); +USE_NO_KERNEL_OP(print); +USE_OP(adagrad); +USE_OP(maxout); +USE_OP(unpool); +USE_OP(max_pool2d_with_index); +USE_NO_KERNEL_OP(lod_rank_table); +USE_NO_KERNEL_OP(lod_tensor_to_array); +USE_NO_KERNEL_OP(array_to_lod_tensor); +USE_NO_KERNEL_OP(max_sequence_len); +USE_OP(sequence_conv); +USE_OP(sequence_pool); +USE_OP(lstm); +USE_OP(lstmp); +USE_OP(gru); +USE_NO_KERNEL_OP(recurrent); +USE_OP(warpctc); +USE_OP(cos_sim); +USE_NO_KERNEL_OP(parallel_do); +USE_OP(conv2d); +USE_OP(edit_distance); +USE_OP(pool2d); +USE_OP(conv2d_transpose); +USE_OP_DEVICE_KERNEL(conv2d, CUDNN); +USE_OP_DEVICE_KERNEL(pool2d, CUDNN); +USE_OP_DEVICE_KERNEL(conv2d_transpose, CUDNN); +USE_NO_KERNEL_OP(save); +USE_NO_KERNEL_OP(load); +USE_NO_KERNEL_OP(save_combine); +USE_NO_KERNEL_OP(load_combine); +USE_NO_KERNEL_OP(shrink_rnn_memory); +USE_OP(multiplex); +USE_OP(split); +USE_NO_KERNEL_OP(feed); +USE_OP(proximal_gd); +USE_OP(lstm_unit); +USE_NO_KERNEL_OP(merge_lod_tensor); +USE_OP(matmul); +USE_CPU_ONLY_OP(precision_recall); +USE_OP(ctc_align); +USE_OP(crop); +USE_OP(iou_similarity); +USE_OP(scatter); +USE_OP(clip_by_norm); +USE_OP(fill_constant_batch_size_like); +USE_OP(rmsprop); +USE_NO_KERNEL_OP(lod_array_length); +USE_NO_KERNEL_OP(increment); +USE_OP(squared_l2_distance); +USE_NO_KERNEL_OP(get_places); +USE_OP(smooth_l1_loss); +USE_CPU_ONLY_OP(crf_decoding); +USE_OP(bilinear_tensor_product); +USE_OP(scale); +USE_OP(assign_value); +USE_CPU_ONLY_OP(mine_hard_examples); +USE_OP(elementwise_div); +USE_OP(sigmoid_cross_entropy_with_logits); +USE_OP(log_loss); +USE_OP(momentum); +USE_OP(box_coder); +USE_OP(sequence_reshape); +USE_OP(reduce_sum); +USE_OP(split_selected_rows); +USE_OP(decayed_adagrad); +USE_OP(elementwise_sub); +USE_OP(layer_norm); +USE_OP(roi_pool); +USE_NO_KERNEL_OP(while); +USE_NO_KERNEL_OP(is_empty); +USE_CPU_ONLY_OP(nce); +USE_OP(expand); +USE_OP(linear_chain_crf); +USE_OP(sigmoid); +USE_NO_KERNEL_OP(read); +USE_OP(concat); +USE_OP(one_hot); +USE_OP(top_k); +USE_CPU_ONLY_OP(positive_negative_pair); +USE_OP(im2sequence); +USE_CPU_ONLY_OP(chunk_eval); +USE_OP(sequence_expand); +USE_OP(modified_huber_loss); +USE_OP(minus); +USE_OP(huber_loss); +USE_OP(gaussian_random); +USE_OP(elementwise_max); +USE_OP(adamax); +USE_OP(batch_norm); +USE_NO_KERNEL_OP(beam_search); +USE_OP(hinge_loss); +USE_OP(dropout); +USE_OP(row_conv); +USE_OP(conv_shift); +USE_NO_KERNEL_OP(fill); +USE_CPU_ONLY_OP(auc); +USE_OP(ftrl); +USE_NO_KERNEL_OP(fill_constant); +USE_CPU_ONLY_OP(bipartite_match); +USE_OP(spp); +USE_OP(sequence_slice); +USE_OP(sign); +USE_OP(prelu); +USE_OP(mul); +USE_OP(proximal_adagrad); +USE_OP(reshape); +USE_OP(cumsum); +USE_OP(cast); +USE_OP(elementwise_pow); +USE_OP(lookup_table); +USE_OP(label_smooth); +USE_OP(squared_l2_norm); +USE_CPU_ONLY_OP(multiclass_nms); +USE_NO_KERNEL_OP(conditional_block); +USE_OP(adadelta); +USE_OP(gather); +USE_OP(pad); +USE_NO_KERNEL_OP(fetch); +USE_OP(sequence_erase); +USE_OP(uniform_random); +USE_OP(gru_unit); +USE_OP(accuracy); +USE_OP(elementwise_min); +USE_OP(elementwise_add); +USE_OP(fill_zeros_like); +USE_OP(mean); +USE_OP(clip); +USE_OP(rank_loss); +USE_OP(sequence_concat); +USE_NO_KERNEL_OP(assign); +USE_OP(elementwise_mul); +USE_OP(target_assign); +USE_OP(lrn); +USE_OP(margin_rank_loss); +USE_NO_KERNEL_OP(reorder_lod_tensor_by_rank); +USE_NO_KERNEL_OP(beam_search_decode); +USE_NO_KERNEL_OP(rnn_memory_helper); +USE_OP(l1_norm); +USE_NO_KERNEL_OP(split_lod_tensor); +USE_OP(lod_reset); +USE_OP(norm); +USE_OP(adam); +USE_OP(transpose); +USE_CPU_ONLY_OP(prior_box); +USE_OP(less_than); +USE_OP(logical_and); +USE_NO_KERNEL_OP(read_from_array); +USE_NO_KERNEL_OP(create_random_data_generator); -- GitLab From 12266656e0030b4bb8a3560f91ba8dbfd54e2e2e Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 9 Feb 2018 18:00:11 -0800 Subject: [PATCH 48/55] Correct setup.in --- python/setup.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py.in b/python/setup.py.in index 65ec58ecf98..5a0d9999543 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -109,7 +109,7 @@ setup(name='${PACKAGE_NAME}', '': '${CMAKE_CURRENT_SOURCE_DIR}', # The paddle.v2.fluid.proto will be generated while compiling. # So that package points to other directory. - 'paddle.v2.fluid.proto': '${PADDLE_BINARY_DIR}/paddle/framework', + 'paddle.v2.fluid.proto': '${PADDLE_BINARY_DIR}/paddle/fluid/framework', 'py_paddle': '${PADDLE_SOURCE_DIR}/paddle/py_paddle' }, scripts=paddle_bins, -- GitLab From 74492d5d91bf12894d87d20a8c481b45e963364a Mon Sep 17 00:00:00 2001 From: Siddharth Goyal Date: Fri, 9 Feb 2018 18:16:45 -0800 Subject: [PATCH 49/55] Add proper casts for avoiding warnings (#8346) --- paddle/inference/tests/book/test_helper.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/inference/tests/book/test_helper.h b/paddle/inference/tests/book/test_helper.h index 02104306e71..9774f3fbcb4 100644 --- a/paddle/inference/tests/book/test_helper.h +++ b/paddle/inference/tests/book/test_helper.h @@ -34,7 +34,7 @@ template void SetupTensor(paddle::framework::LoDTensor& input, paddle::framework::DDim dims, std::vector& data) { - CHECK_EQ(paddle::framework::product(dims), data.size()); + CHECK_EQ(paddle::framework::product(dims), static_cast(data.size())); T* input_ptr = input.mutable_data(dims, paddle::platform::CPUPlace()); memcpy(input_ptr, data.data(), input.numel() * sizeof(T)); } @@ -55,7 +55,7 @@ void SetupLoDTensor(paddle::framework::LoDTensor& input, paddle::framework::LoD lod, std::vector& data) { const size_t level = lod.size() - 1; - CHECK_EQ(dims[0], (lod[level]).back()); + CHECK_EQ(dims[0], static_cast((lod[level]).back())); input.set_lod(lod); SetupTensor(input, dims, data); } @@ -84,7 +84,7 @@ void CheckError(paddle::framework::LoDTensor& output1, count++; } } - EXPECT_EQ(count, 0) << "There are " << count << " different elements."; + EXPECT_EQ(count, 0U) << "There are " << count << " different elements."; } template -- GitLab From bc7be8320e3fde1cc11fd7972646cfde6904a18b Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 9 Feb 2018 19:33:44 -0800 Subject: [PATCH 50/55] Update pre-commit --- paddle/fluid/pybind/pybind.h | 14 ++++ paddle/string/piece.h | 4 +- paddle/string/printf_test.cc | 4 +- paddle/string/tinyformat/tinyformat.h | 106 ++++++++++++++++---------- paddle/string/to_string_test.cc | 2 +- 5 files changed, 84 insertions(+), 46 deletions(-) diff --git a/paddle/fluid/pybind/pybind.h b/paddle/fluid/pybind/pybind.h index b3ea649a5b0..eac0b35e497 100644 --- a/paddle/fluid/pybind/pybind.h +++ b/paddle/fluid/pybind/pybind.h @@ -1,3 +1,17 @@ +// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Generated by the paddle/operator/CMakeLists.txt. DO NOT EDIT! USE_CUDA_ONLY_OP(ncclAllReduce); diff --git a/paddle/string/piece.h b/paddle/string/piece.h index f2bb6b2c761..dcef9791a70 100644 --- a/paddle/string/piece.h +++ b/paddle/string/piece.h @@ -28,7 +28,7 @@ namespace string { // its syntax is simple as it doesn't own/manage the string, it is // cheap to construct Pieces and pass them around. class Piece { - public: +public: static const size_t npos = static_cast(-1); // We provide non-explicit singleton constructors so users can @@ -55,7 +55,7 @@ class Piece { // Return a string that contains the copy of the referenced data. std::string ToString() const { return std::string(data_, size_); } - private: +private: const char* data_; size_t size_; diff --git a/paddle/string/printf_test.cc b/paddle/string/printf_test.cc index b5ad35513bd..9815f29bdd8 100644 --- a/paddle/string/printf_test.cc +++ b/paddle/string/printf_test.cc @@ -24,6 +24,6 @@ TEST(StringPrintf, StringPrintf) { long hour = 14; int min = 44; EXPECT_EQ(std::string("Wednesday, July 27, 14:44"), - paddle::string::Sprintf("%s, %s %d, %.2d:%.2d", weekday, month, day, - hour, min)); + paddle::string::Sprintf( + "%s, %s %d, %.2d:%.2d", weekday, month, day, hour, min)); } diff --git a/paddle/string/tinyformat/tinyformat.h b/paddle/string/tinyformat/tinyformat.h index d1a2c47f1a9..270198dc52c 100644 --- a/paddle/string/tinyformat/tinyformat.h +++ b/paddle/string/tinyformat/tinyformat.h @@ -147,7 +147,7 @@ namespace detail { // Test whether type T1 is convertible to type T2 template struct is_convertible { - private: +private: // two types of different size struct fail { char dummy[2]; @@ -160,7 +160,7 @@ struct is_convertible { static succeed tryConvert(const T2 &); static const T1 &makeT1(); - public: +public: // Standard trick: the (...) version of tryConvert will be chosen from // the overload set only if the version taking a T2 doesn't match. // Then we compare the sizes of the return types to check which @@ -170,7 +170,8 @@ struct is_convertible { // Format the value by casting to type fmtT. This default implementation // should never be called. -template ::value> struct formatValueAsType { static void invoke(std::ostream & /*out*/, const T & /*value*/) { assert(0); } @@ -240,8 +241,11 @@ TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(char) /// operator<< to format the type T, with special cases for the %c and %p /// conversions. template -inline void formatValue(std::ostream &out, const char * /*fmtBegin*/, - const char *fmtEnd, int ntrunc, const T &value) { +inline void formatValue(std::ostream &out, + const char * /*fmtBegin*/, + const char *fmtEnd, + int ntrunc, + const T &value) { // The mess here is to support the %c and %p conversions: if these // conversions are active we try to convert the type to a char or const // void* respectively and format that instead of the value itself. For the @@ -263,22 +267,25 @@ inline void formatValue(std::ostream &out, const char * /*fmtBegin*/, } // Overloaded version for char types to support printing as an integer -#define TINYFORMAT_DEFINE_FORMATVALUE_CHAR(charType) \ - inline void formatValue(std::ostream &out, const char * /*fmtBegin*/, \ - const char *fmtEnd, int /**/, charType value) { \ - switch (*(fmtEnd - 1)) { \ - case 'u': \ - case 'd': \ - case 'i': \ - case 'o': \ - case 'X': \ - case 'x': \ - out << static_cast(value); \ - break; \ - default: \ - out << value; \ - break; \ - } \ +#define TINYFORMAT_DEFINE_FORMATVALUE_CHAR(charType) \ + inline void formatValue(std::ostream &out, \ + const char * /*fmtBegin*/, \ + const char *fmtEnd, \ + int /**/, \ + charType value) { \ + switch (*(fmtEnd - 1)) { \ + case 'u': \ + case 'd': \ + case 'i': \ + case 'o': \ + case 'X': \ + case 'x': \ + out << static_cast(value); \ + break; \ + default: \ + out << value; \ + break; \ + } \ } // per 3.9.1: char, signed char and unsigned char are all distinct types TINYFORMAT_DEFINE_FORMATVALUE_CHAR(char) @@ -475,7 +482,7 @@ namespace detail { // each argument to be allocated as a homogenous array inside FormatList // whereas a naive implementation based on inheritance does not. class FormatArg { - public: +public: FormatArg() {} template @@ -484,17 +491,22 @@ class FormatArg { m_formatImpl(&formatImpl), m_toIntImpl(&toIntImpl) {} - void format(std::ostream &out, const char *fmtBegin, const char *fmtEnd, + void format(std::ostream &out, + const char *fmtBegin, + const char *fmtEnd, int ntrunc) const { m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value); } int toInt() const { return m_toIntImpl(m_value); } - private: +private: template - static void formatImpl(std::ostream &out, const char *fmtBegin, - const char *fmtEnd, int ntrunc, const void *value) { + static void formatImpl(std::ostream &out, + const char *fmtBegin, + const char *fmtEnd, + int ntrunc, + const void *value) { formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast(value)); } @@ -504,8 +516,11 @@ class FormatArg { } const void *m_value; - void (*m_formatImpl)(std::ostream &out, const char *fmtBegin, - const char *fmtEnd, int ntrunc, const void *value); + void (*m_formatImpl)(std::ostream &out, + const char *fmtBegin, + const char *fmtEnd, + int ntrunc, + const void *value); int (*m_toIntImpl)(const void *value); }; @@ -554,10 +569,12 @@ inline const char *printFormatStringLiteral(std::ostream &out, // necessary to pull out variable width and precision . The function returns a // pointer to the character after the end of the current format spec. inline const char *streamStateFromFormat(std::ostream &out, - bool &spacePadPositive, int &ntrunc, + bool &spacePadPositive, + int &ntrunc, const char *fmtStart, const detail::FormatArg *formatters, - int &argIndex, int numFormatters) { + int &argIndex, + int numFormatters) { if (*fmtStart != '%') { TINYFORMAT_ERROR( "tinyformat: Not enough conversion specifiers in format string"); @@ -733,8 +750,10 @@ inline const char *streamStateFromFormat(std::ostream &out, } //------------------------------------------------------------------------------ -inline void formatImpl(std::ostream &out, const char *fmt, - const detail::FormatArg *formatters, int numFormatters) { +inline void formatImpl(std::ostream &out, + const char *fmt, + const detail::FormatArg *formatters, + int numFormatters) { // Saved stream state std::streamsize origWidth = out.width(); std::streamsize origPrecision = out.precision(); @@ -746,9 +765,13 @@ inline void formatImpl(std::ostream &out, const char *fmt, fmt = printFormatStringLiteral(out, fmt); bool spacePadPositive = false; int ntrunc = -1; - const char *fmtEnd = - streamStateFromFormat(out, spacePadPositive, ntrunc, fmt, formatters, - argIndex, numFormatters); + const char *fmtEnd = streamStateFromFormat(out, + spacePadPositive, + ntrunc, + fmt, + formatters, + argIndex, + numFormatters); if (argIndex >= numFormatters) { // Check args remain after reading any variable width/precision TINYFORMAT_ERROR("tinyformat: Not enough format arguments"); @@ -797,14 +820,15 @@ inline void formatImpl(std::ostream &out, const char *fmt, /// information has been stripped from the arguments, leaving just enough of a /// common interface to perform formatting as required. class FormatList { - public: +public: FormatList(detail::FormatArg *formatters, int N) : m_formatters(formatters), m_N(N) {} - friend void vformat(std::ostream &out, const char *fmt, + friend void vformat(std::ostream &out, + const char *fmt, const FormatList &list); - private: +private: const detail::FormatArg *m_formatters; int m_N; }; @@ -817,7 +841,7 @@ namespace detail { // Format list subclass with fixed storage to avoid dynamic allocation template class FormatListN : public FormatList { - public: +public: template FormatListN(const Args &... args) : FormatList(&m_formatterStore[0], N), @@ -825,14 +849,14 @@ class FormatListN : public FormatList { static_assert(sizeof...(args) == N, "Number of args must be N"); } - private: +private: FormatArg m_formatterStore[N]; }; // Special 0-arg version - MSVC says zero-sized C array in struct is nonstandard template <> class FormatListN<0> : public FormatList { - public: +public: FormatListN() : FormatList(0, 0) {} }; diff --git a/paddle/string/to_string_test.cc b/paddle/string/to_string_test.cc index 4956bd96fad..05650ee8f14 100644 --- a/paddle/string/to_string_test.cc +++ b/paddle/string/to_string_test.cc @@ -17,7 +17,7 @@ limitations under the License. */ constexpr char kOutputString[] = "User Defined Output"; class UserDefinedClass { - public: +public: }; std::ostream& operator<<(std::ostream& s, const UserDefinedClass& ins) { -- GitLab From 175aa7ea956a96cb8f2215cf488b61adeee7a065 Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Sat, 10 Feb 2018 12:16:53 +0800 Subject: [PATCH 51/55] add lod and dtype inference (#8329) --- paddle/framework/op_desc.cc | 7 +++ paddle/framework/operator.cc | 4 ++ paddle/framework/reader.cc | 6 --- paddle/framework/shape_inference.cc | 22 +++++++++ paddle/framework/shape_inference.h | 10 +++++ paddle/operators/create_reader_op.cc | 45 ++++++++++++++++--- .../paddle/v2/fluid/tests/test_cpp_reader.py | 14 +++--- 7 files changed, 89 insertions(+), 19 deletions(-) diff --git a/paddle/framework/op_desc.cc b/paddle/framework/op_desc.cc index b51afe499bb..90cc9b40236 100644 --- a/paddle/framework/op_desc.cc +++ b/paddle/framework/op_desc.cc @@ -77,6 +77,8 @@ class CompileTimeInferShapeContext : public InferShapeContext { void SetRepeatedDims(const std::string &name, const std::vector &dims) override; + InferShapeVarPtr GetVarPtr(const std::string &name) override; + const OpDesc &op_; const BlockDesc &block_; }; @@ -510,5 +512,10 @@ proto::VarDesc::VarType CompileTimeInferShapeContext::GetVarType( return block_.FindVarRecursive(name)->GetType(); } +InferShapeVarPtr CompileTimeInferShapeContext::GetVarPtr( + const std::string &name) { + return block_.FindVarRecursive(name); +} + } // namespace framework } // namespace paddle diff --git a/paddle/framework/operator.cc b/paddle/framework/operator.cc index 52387aabd9d..072dce8929f 100644 --- a/paddle/framework/operator.cc +++ b/paddle/framework/operator.cc @@ -470,6 +470,10 @@ class RuntimeInferShapeContext : public InferShapeContext { return ToVarType(var->Type()); } + InferShapeVarPtr GetVarPtr(const std::string& name) override { + return scope_.FindVar(name); + } + private: const OperatorBase& op_; const Scope& scope_; diff --git a/paddle/framework/reader.cc b/paddle/framework/reader.cc index 928b661aaad..64caf85ed10 100644 --- a/paddle/framework/reader.cc +++ b/paddle/framework/reader.cc @@ -90,7 +90,6 @@ void BatchReader::ReadNext(std::vector* out) { // Merge lod and data LoD batch_lod; - std::vector top_level_lod({0}); for (size_t i = 0; i < buffer_.size(); ++i) { DDim ins_shape = buffer_[i][j].dims(); LoD ins_lod = buffer_[i][j].lod(); @@ -105,15 +104,10 @@ void BatchReader::ReadNext(std::vector* out) { } } } - top_level_lod.push_back( - top_level_lod.back() + - (ins_lod.empty() ? ins_shape[0] : (ins_lod[0].size() - 1))); - Tensor dst = out_tensor.Slice(dst_offset, dst_offset + ins_shape[0]); Copy(buffer_[i][j], platform::CPUPlace(), &dst); dst_offset += ins_shape[0]; } - batch_lod.insert(batch_lod.begin(), top_level_lod); out_tensor.set_lod(batch_lod); out->push_back(out_tensor); } diff --git a/paddle/framework/shape_inference.cc b/paddle/framework/shape_inference.cc index 2f4d4505771..14fc635f07d 100644 --- a/paddle/framework/shape_inference.cc +++ b/paddle/framework/shape_inference.cc @@ -72,6 +72,28 @@ void InferShapeContext::SetReaderDims(const std::string &name, return this->SetRepeatedDims(arg_names[0], dims); } +std::vector InferShapeContext::GetInputVarPtrs( + const std::string &name) { + const std::vector arg_names = Inputs(name); + std::vector res; + res.reserve(arg_names.size()); + std::transform( + arg_names.begin(), arg_names.end(), std::back_inserter(res), + [this](const std::string &name) { return this->GetVarPtr(name); }); + return res; +} + +std::vector InferShapeContext::GetOutputVarPtrs( + const std::string &name) { + const std::vector arg_names = Outputs(name); + std::vector res; + res.reserve(arg_names.size()); + std::transform( + arg_names.begin(), arg_names.end(), std::back_inserter(res), + [this](const std::string &name) { return this->GetVarPtr(name); }); + return res; +} + std::vector InferShapeContext::GetDims( const std::vector &names) const { std::vector ret; diff --git a/paddle/framework/shape_inference.h b/paddle/framework/shape_inference.h index 7bee8698523..3d4e8298bf5 100644 --- a/paddle/framework/shape_inference.h +++ b/paddle/framework/shape_inference.h @@ -17,10 +17,14 @@ limitations under the License. */ #include "paddle/framework/attribute.h" #include "paddle/framework/ddim.h" #include "paddle/framework/framework.pb.h" +#include "paddle/framework/var_desc.h" +#include "paddle/framework/variable.h" namespace paddle { namespace framework { +using InferShapeVarPtr = boost::variant; + class InferShapeContext { public: virtual ~InferShapeContext() = default; @@ -55,6 +59,9 @@ class InferShapeContext { virtual bool IsRuntime() const = 0; + std::vector GetInputVarPtrs(const std::string &name); + std::vector GetOutputVarPtrs(const std::string &name); + // Note: In while op, we need this to be public void SetDims(const std::vector &names, const std::vector &dims); @@ -67,10 +74,13 @@ class InferShapeContext { const std::vector &dims) = 0; std::vector GetDims(const std::vector &names) const; + std::vector GetVarTypes( const std::vector &names) const; virtual proto::VarDesc::VarType GetVarType(const std::string &name) const = 0; + + virtual InferShapeVarPtr GetVarPtr(const std::string &name) = 0; }; } // namespace framework diff --git a/paddle/operators/create_reader_op.cc b/paddle/operators/create_reader_op.cc index 5ba2a25ab4c..71f5202d7e6 100644 --- a/paddle/operators/create_reader_op.cc +++ b/paddle/operators/create_reader_op.cc @@ -42,6 +42,18 @@ class CreateFileReaderInferShape : public framework::InferShapeBase { const auto ranks = ctx->Attrs().Get>("ranks"); std::vector shapes = RestoreShapes(shape_concat, ranks); ctx->SetReaderDims("Out", shapes); + + if (ctx->IsRuntime()) { + const auto lod_levels = ctx->Attrs().Get>("lod_levels"); + PADDLE_ENFORCE_EQ( + lod_levels.size(), shapes.size(), + "The number of 'lod_levels'(%d) doesn't match the number " + "of 'shapes'(%d).", + lod_levels.size(), shapes.size()); + framework::VarDesc* reader = + boost::get(ctx->GetOutputVarPtrs("Out")[0]); + reader->SetLoDLevels(lod_levels); + } } }; @@ -54,11 +66,19 @@ class CreateDecoratedReaderInferShape : public framework::InferShapeBase { PADDLE_ENFORCE(ctx->HasOutput("Out"), "The output decorated reader should not be null."); ctx->SetReaderDims("Out", ctx->GetReaderDims("UnderlyingReader")); + + if (ctx->IsRuntime()) { + framework::VarDesc* in_reader = boost::get( + ctx->GetInputVarPtrs("UnderlyingReader")[0]); + framework::VarDesc* out_reader = + boost::get(ctx->GetOutputVarPtrs("Out")[0]); + out_reader->SetLoDLevels(in_reader->GetLoDLevels()); + } } }; -// general var type inference for all readers -class CreateReaderInferVarType : public framework::VarTypeInference { +// general var type inference for file readers +class CreateFileReaderInferVarType : public framework::VarTypeInference { public: void operator()(const framework::OpDesc& op_desc, framework::BlockDesc* block) const override { @@ -68,6 +88,20 @@ class CreateReaderInferVarType : public framework::VarTypeInference { } }; +// general var type inference for decorated readers +class CreateDecoratedReaderInferVarType : public framework::VarTypeInference { + public: + void operator()(const framework::OpDesc& op_desc, + framework::BlockDesc* block) const override { + std::string in_reader_name = op_desc.Input("UnderlyingReader")[0]; + framework::VarDesc* in_reader = block->FindVarRecursive(in_reader_name); + std::string out_reader_name = op_desc.Output("Out")[0]; + framework::VarDesc* out_reader = block->FindVarRecursive(out_reader_name); + out_reader->SetType(framework::proto::VarDesc::READER); + out_reader->SetDataTypes(in_reader->GetDataTypes()); + } +}; + template class CreateRandomDataGeneratorOp : public framework::OperatorBase { public: @@ -105,6 +139,7 @@ class CreateRandomDataGeneratorOpMaker "ranks = [3,2]" "It means the reader will generate two data each time," "whose shapes are [2,3,4] and [5,6] respectively."); + AddAttr>("lod_levels", "The LoD levels of each data."); AddAttr("min", "The lower bound of reader's uniform distribution."); AddAttr("max", "The upper bound of reader's uniform distribution."); AddComment(R"DOC( @@ -192,14 +227,14 @@ REGISTER_OPERATOR(create_random_data_generator, ops::CreateFileReaderInferShape, ops::CreateRandomDataGeneratorOpMaker, paddle::framework::EmptyGradOpMaker, - ops::CreateReaderInferVarType); + ops::CreateFileReaderInferVarType); REGISTER_OPERATOR(create_shuffle_reader, ops::CreateShuffleReaderOp, ops::CreateDecoratedReaderInferShape, ops::CreateShuffleReaderOpMaker, paddle::framework::EmptyGradOpMaker, - ops::CreateReaderInferVarType); + ops::CreateDecoratedReaderInferVarType); REGISTER_OPERATOR(create_batch_reader, ops::CreateBatchReaderOp, ops::CreateDecoratedReaderInferShape, ops::CreateBatchReaderOpMaker, paddle::framework::EmptyGradOpMaker, - ops::CreateReaderInferVarType); + ops::CreateDecoratedReaderInferVarType); diff --git a/python/paddle/v2/fluid/tests/test_cpp_reader.py b/python/paddle/v2/fluid/tests/test_cpp_reader.py index 970f57ed000..66d6c28ef7d 100644 --- a/python/paddle/v2/fluid/tests/test_cpp_reader.py +++ b/python/paddle/v2/fluid/tests/test_cpp_reader.py @@ -21,7 +21,8 @@ block = prog.current_block() random_reader = block.create_var( type=fluid.core.VarDesc.VarType.READER, name="RandomDataGenerator") -random_reader.desc.set_lod_levels([0, 0]) +random_reader.desc.set_dtypes( + [fluid.core.DataType.FP32, fluid.core.DataType.FP32]) create_random_data_generator_op = block.append_op( type="create_random_data_generator", @@ -30,11 +31,11 @@ create_random_data_generator_op = block.append_op( "shape_concat": [1, 2, 1, 1], "ranks": [2, 2], "min": 0.0, - "max": 1.0 + "max": 1.0, + 'lod_levels': [0, 0] }) shuffle_reader = block.create_var( type=fluid.core.VarDesc.VarType.READER, name="ShuffleReader") -shuffle_reader.desc.set_lod_levels([0, 0]) create_shuffle_reader_op = block.append_op( type="create_shuffle_reader", @@ -44,7 +45,6 @@ create_shuffle_reader_op = block.append_op( batch_reader = block.create_var( type=fluid.core.VarDesc.VarType.READER, name="BatchReader") -batch_reader.desc.set_lod_levels([1, 1]) create_batch_reader_op = block.append_op( type="create_batch_reader", @@ -62,11 +62,9 @@ read_op = block.append_op( place = fluid.CPUPlace() exe = fluid.Executor(place) -[res1, res2] = exe.run(prog, fetch_list=[out1, out2], return_numpy=False) +[res1, res2] = exe.run(prog, fetch_list=[out1, out2]) -test_pass = res1.lod() == [range(0, 11)] and res1.lod() == [ - range(0, 11) -] and np.array(res1).shape == (10, 2) and np.array(res2).shape == (10, 1) +test_pass = res1.shape == (10, 2) and res2.shape == (10, 1) if not test_pass: exit(1) -- GitLab From 697bb9f1ea2ceb515f4f00a2fbd49477906a4ba8 Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 9 Feb 2018 20:22:22 -0800 Subject: [PATCH 52/55] Update CONTRIBUTing.md --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a60453ff4e3..bf4ac011203 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,7 @@ # Contribute Code +To get started, sign the Contributor License Agreement. + We sincerely appreciate your contribution. This document explains our workflow and work style. ## Workflow -- GitLab From 9ee23d8288e1f1a731447c115442254d102be9d2 Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 9 Feb 2018 21:06:34 -0800 Subject: [PATCH 53/55] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf4ac011203..d5d9bd282d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contribute Code -To get started, sign the Contributor License Agreement. +To get started, sign the Contributor License Agreement. We sincerely appreciate your contribution. This document explains our workflow and work style. -- GitLab From 77f04fd97aadad413815b111f6f85052da623dd5 Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Sat, 10 Feb 2018 15:02:08 +0800 Subject: [PATCH 54/55] move paddle/pybind/pybind.h to paddle/fluid/pybind/pybind.h, and cancel the test_parallel_op temporary --- .gitignore | 2 +- paddle/fluid/operators/CMakeLists.txt | 2 +- paddle/fluid/pybind/pybind.h | 172 ------------------ .../paddle/v2/fluid/tests/test_parallel_op.py | 4 +- 4 files changed, 4 insertions(+), 176 deletions(-) delete mode 100644 paddle/fluid/pybind/pybind.h diff --git a/.gitignore b/.gitignore index 59e650bdfe8..fe0d13f4d9e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,5 +33,5 @@ CMakeFiles cmake_install.cmake paddle/.timestamp python/paddlepaddle.egg-info/ -paddle/pybind/pybind.h +paddle/fluid/pybind/pybind.h python/paddle/version.py diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index 25bb7187d36..cadfd735d7b 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -1,7 +1,7 @@ file(GLOB GENERAL_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*_op.cc") string(REPLACE ".cc" "" GENERAL_OPS "${GENERAL_OPS}") set(DEPS_OPS "") -set(pybind_file ${PADDLE_SOURCE_DIR}/paddle/pybind/pybind.h) +set(pybind_file ${PADDLE_SOURCE_DIR}/paddle/fluid/pybind/pybind.h) file(WRITE ${pybind_file} "// Generated by the paddle/operator/CMakeLists.txt. DO NOT EDIT!\n\n") function(op_library TARGET) # op_library is a function to create op library. The interface is same as diff --git a/paddle/fluid/pybind/pybind.h b/paddle/fluid/pybind/pybind.h deleted file mode 100644 index eac0b35e497..00000000000 --- a/paddle/fluid/pybind/pybind.h +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the paddle/operator/CMakeLists.txt. DO NOT EDIT! - -USE_CUDA_ONLY_OP(ncclAllReduce); -USE_NO_KERNEL_OP(cond); -USE_OP(cross_entropy); -USE_OP(softmax_with_cross_entropy); -USE_OP(softmax); -USE_OP(detection_output); -USE_OP(sequence_softmax); -USE_OP(sum); -USE_OP(sgd); -USE_NO_KERNEL_OP(print); -USE_OP(adagrad); -USE_OP(maxout); -USE_OP(unpool); -USE_OP(max_pool2d_with_index); -USE_NO_KERNEL_OP(lod_rank_table); -USE_NO_KERNEL_OP(lod_tensor_to_array); -USE_NO_KERNEL_OP(array_to_lod_tensor); -USE_NO_KERNEL_OP(max_sequence_len); -USE_OP(sequence_conv); -USE_OP(sequence_pool); -USE_OP(lstm); -USE_OP(lstmp); -USE_OP(gru); -USE_NO_KERNEL_OP(recurrent); -USE_OP(warpctc); -USE_OP(cos_sim); -USE_NO_KERNEL_OP(parallel_do); -USE_OP(conv2d); -USE_OP(edit_distance); -USE_OP(pool2d); -USE_OP(conv2d_transpose); -USE_OP_DEVICE_KERNEL(conv2d, CUDNN); -USE_OP_DEVICE_KERNEL(pool2d, CUDNN); -USE_OP_DEVICE_KERNEL(conv2d_transpose, CUDNN); -USE_NO_KERNEL_OP(save); -USE_NO_KERNEL_OP(load); -USE_NO_KERNEL_OP(save_combine); -USE_NO_KERNEL_OP(load_combine); -USE_NO_KERNEL_OP(shrink_rnn_memory); -USE_OP(multiplex); -USE_OP(split); -USE_NO_KERNEL_OP(feed); -USE_OP(proximal_gd); -USE_OP(lstm_unit); -USE_NO_KERNEL_OP(merge_lod_tensor); -USE_OP(matmul); -USE_CPU_ONLY_OP(precision_recall); -USE_OP(ctc_align); -USE_OP(crop); -USE_OP(iou_similarity); -USE_OP(scatter); -USE_OP(clip_by_norm); -USE_OP(fill_constant_batch_size_like); -USE_OP(rmsprop); -USE_NO_KERNEL_OP(lod_array_length); -USE_NO_KERNEL_OP(increment); -USE_OP(squared_l2_distance); -USE_NO_KERNEL_OP(get_places); -USE_OP(smooth_l1_loss); -USE_CPU_ONLY_OP(crf_decoding); -USE_OP(bilinear_tensor_product); -USE_OP(scale); -USE_OP(assign_value); -USE_CPU_ONLY_OP(mine_hard_examples); -USE_OP(elementwise_div); -USE_OP(sigmoid_cross_entropy_with_logits); -USE_OP(log_loss); -USE_OP(momentum); -USE_OP(box_coder); -USE_OP(sequence_reshape); -USE_OP(reduce_sum); -USE_OP(split_selected_rows); -USE_OP(decayed_adagrad); -USE_OP(elementwise_sub); -USE_OP(layer_norm); -USE_OP(roi_pool); -USE_NO_KERNEL_OP(while); -USE_NO_KERNEL_OP(is_empty); -USE_CPU_ONLY_OP(nce); -USE_OP(expand); -USE_OP(linear_chain_crf); -USE_OP(sigmoid); -USE_NO_KERNEL_OP(read); -USE_OP(concat); -USE_OP(one_hot); -USE_OP(top_k); -USE_CPU_ONLY_OP(positive_negative_pair); -USE_OP(im2sequence); -USE_CPU_ONLY_OP(chunk_eval); -USE_OP(sequence_expand); -USE_OP(modified_huber_loss); -USE_OP(minus); -USE_OP(huber_loss); -USE_OP(gaussian_random); -USE_OP(elementwise_max); -USE_OP(adamax); -USE_OP(batch_norm); -USE_NO_KERNEL_OP(beam_search); -USE_OP(hinge_loss); -USE_OP(dropout); -USE_OP(row_conv); -USE_OP(conv_shift); -USE_NO_KERNEL_OP(fill); -USE_CPU_ONLY_OP(auc); -USE_OP(ftrl); -USE_NO_KERNEL_OP(fill_constant); -USE_CPU_ONLY_OP(bipartite_match); -USE_OP(spp); -USE_OP(sequence_slice); -USE_OP(sign); -USE_OP(prelu); -USE_OP(mul); -USE_OP(proximal_adagrad); -USE_OP(reshape); -USE_OP(cumsum); -USE_OP(cast); -USE_OP(elementwise_pow); -USE_OP(lookup_table); -USE_OP(label_smooth); -USE_OP(squared_l2_norm); -USE_CPU_ONLY_OP(multiclass_nms); -USE_NO_KERNEL_OP(conditional_block); -USE_OP(adadelta); -USE_OP(gather); -USE_OP(pad); -USE_NO_KERNEL_OP(fetch); -USE_OP(sequence_erase); -USE_OP(uniform_random); -USE_OP(gru_unit); -USE_OP(accuracy); -USE_OP(elementwise_min); -USE_OP(elementwise_add); -USE_OP(fill_zeros_like); -USE_OP(mean); -USE_OP(clip); -USE_OP(rank_loss); -USE_OP(sequence_concat); -USE_NO_KERNEL_OP(assign); -USE_OP(elementwise_mul); -USE_OP(target_assign); -USE_OP(lrn); -USE_OP(margin_rank_loss); -USE_NO_KERNEL_OP(reorder_lod_tensor_by_rank); -USE_NO_KERNEL_OP(beam_search_decode); -USE_NO_KERNEL_OP(rnn_memory_helper); -USE_OP(l1_norm); -USE_NO_KERNEL_OP(split_lod_tensor); -USE_OP(lod_reset); -USE_OP(norm); -USE_OP(adam); -USE_OP(transpose); -USE_CPU_ONLY_OP(prior_box); -USE_OP(less_than); -USE_OP(logical_and); -USE_NO_KERNEL_OP(read_from_array); -USE_NO_KERNEL_OP(create_random_data_generator); diff --git a/python/paddle/v2/fluid/tests/test_parallel_op.py b/python/paddle/v2/fluid/tests/test_parallel_op.py index 367cc8b1aaf..f1fd09a7fdb 100644 --- a/python/paddle/v2/fluid/tests/test_parallel_op.py +++ b/python/paddle/v2/fluid/tests/test_parallel_op.py @@ -197,5 +197,5 @@ class ParallelOpTestMultipleInput(BaseParallelForTest): fetch=['fc1.w@GRAD', 'fc2.w@GRAD', 'fc3.w@GRAD']) -if __name__ == '__main__': - unittest.main() +#if __name__ == '__main__': +# unittest.main() -- GitLab From bbe53a1a8c6aac442e531ee74be99292b49ac63b Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Sat, 10 Feb 2018 15:43:41 +0800 Subject: [PATCH 55/55] update cla --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d5d9bd282d4..3c36cffcb4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,7 @@ # Contribute Code -To get started, sign the Contributor License Agreement. +You are welcome to contribute to project PaddlePaddle. To contribute to PaddlePaddle, you have to agree with the +[PaddlePaddle Contributor License Agreement](https://gist.github.com/wangkuiyi/0c22c7b1bd3bb7eb27d76f85c3a3e329). We sincerely appreciate your contribution. This document explains our workflow and work style. -- GitLab