未验证 提交 f25a4571 编写于 作者: X Xiaoyang LI 提交者: GitHub

fix model_optimize_tool error when using host kernel, fix reshape op build...

fix model_optimize_tool error when using host kernel, fix reshape op build error on ios, test=develop (#1984)
上级 0720653b
......@@ -70,6 +70,7 @@ void Main() {
target_repr.c_str());
}
}
valid_places.emplace_back(TARGET(kHost));
CHECK(!valid_places.empty())
<< "At least one target should be set, should set the "
......
......@@ -60,7 +60,7 @@ bool ReshapeOp::AttachImpl(const cpp::OpDesc &opdesc, lite::Scope *scope) {
}
const std::vector<int> shape_vector = param_.shape;
lite::Tensor *shape_tensor = new lite::Tensor;
shape_tensor->Resize(DDim({shape_vector.size()}));
shape_tensor->Resize({static_cast<int64_t>(shape_vector.size())});
int *data_shape = shape_tensor->mutable_data<int>();
for (int i = 0; i < shape_vector.size(); i++) {
data_shape[i] = shape_vector[i];
......@@ -83,7 +83,7 @@ bool ReshapeOp::AttachImpl(const cpp::OpDesc &opdesc, lite::Scope *scope) {
<< "The shape information must be set by Attr(shape).";
const std::vector<int> shape_vector = param_.shape;
lite::Tensor *shape_tensor = new lite::Tensor;
shape_tensor->Resize(DDim({shape_vector.size()}));
shape_tensor->Resize({static_cast<int64_t>(shape_vector.size())});
int *data_shape = shape_tensor->mutable_data<int>();
for (int i = 0; i < shape_vector.size(); i++) {
data_shape[i] = shape_vector[i];
......@@ -106,7 +106,7 @@ bool Reshape2Op::InferShape() const {
for (size_t i = 0; i < x_dims.size(); i++) {
xshape_dims[i + 1] = x_dims[i];
}
param_.xshape->Resize(DDim(xshape_dims));
param_.xshape->Resize(xshape_dims);
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册