From f23ab48468a588d3766ed8db4f6bfa4af9fd8ff2 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Wed, 6 Sep 2017 17:24:20 +0800 Subject: [PATCH] Fix attr int_64 error. --- paddle/operators/crop_op.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paddle/operators/crop_op.cc b/paddle/operators/crop_op.cc index 75fa42fc18b..77ea51ea79c 100644 --- a/paddle/operators/crop_op.cc +++ b/paddle/operators/crop_op.cc @@ -13,6 +13,7 @@ limitations under the License. */ #include "paddle/operators/crop_op.h" +#include namespace paddle { namespace operators { @@ -32,7 +33,12 @@ class CropOp : public framework::OperatorWithKernel { PADDLE_ENFORCE_EQ( shape.size(), dim0.size(), "Shape size should be equal to dimention size of input tensor."); - ctx.Output("Out")->Resize(paddle::framework::make_ddim(shape)); + std::vector tensor_shape(shape.size()); + for (int i = 0; i < shape.size(); ++i) { + tensor_shape[i] = (int64_t)shape[i]; + } + ctx.Output("Out")->Resize( + paddle::framework::make_ddim(tensor_shape)); } else { ctx.Output("Out")->Resize(Y->dims()); } -- GitLab