diff --git a/paddle/operators/crop_op.cc b/paddle/operators/crop_op.cc index 75fa42fc18b1bde7731584e830dcbe3f7393c6f9..77ea51ea79cc611177c1affe71bd7a45159cd0f9 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()); }