提交 f23ab484 编写于 作者: W wanghaoshuang

Fix attr int_64 error.

上级 96a7c70a
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
limitations under the License. */ limitations under the License. */
#include "paddle/operators/crop_op.h" #include "paddle/operators/crop_op.h"
#include <boost/lexical_cast.hpp>
namespace paddle { namespace paddle {
namespace operators { namespace operators {
...@@ -32,7 +33,12 @@ class CropOp : public framework::OperatorWithKernel { ...@@ -32,7 +33,12 @@ class CropOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_EQ( PADDLE_ENFORCE_EQ(
shape.size(), dim0.size(), shape.size(), dim0.size(),
"Shape size should be equal to dimention size of input tensor."); "Shape size should be equal to dimention size of input tensor.");
ctx.Output<Tensor>("Out")->Resize(paddle::framework::make_ddim(shape)); std::vector<int64_t> tensor_shape(shape.size());
for (int i = 0; i < shape.size(); ++i) {
tensor_shape[i] = (int64_t)shape[i];
}
ctx.Output<Tensor>("Out")->Resize(
paddle::framework::make_ddim(tensor_shape));
} else { } else {
ctx.Output<Tensor>("Out")->Resize(Y->dims()); ctx.Output<Tensor>("Out")->Resize(Y->dims());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册