提交 34105532 编写于 作者: Y yangfei

Merge branch 'develop' of https://github.com/PaddlePaddle/paddle-mobile into develop

...@@ -82,6 +82,7 @@ std::unordered_map< ...@@ -82,6 +82,7 @@ std::unordered_map<
{G_OP_TYPE_FUSION_CONV_ADD, {{"Input"}, {"Out"}}}, {G_OP_TYPE_FUSION_CONV_ADD, {{"Input"}, {"Out"}}},
{G_OP_TYPE_RELU, {{"X"}, {"Out"}}}, {G_OP_TYPE_RELU, {{"X"}, {"Out"}}},
{G_OP_TYPE_SOFTMAX, {{"X"}, {"Out"}}}, {G_OP_TYPE_SOFTMAX, {{"X"}, {"Out"}}},
{G_OP_TYPE_SIGMOID, {{"X"}, {"Out"}}},
{G_OP_TYPE_MUL, {{"X"}, {"Out"}}}, {G_OP_TYPE_MUL, {{"X"}, {"Out"}}},
{G_OP_TYPE_ELEMENTWISE_ADD, {{"X", "Y"}, {"Out"}}}, {G_OP_TYPE_ELEMENTWISE_ADD, {{"X", "Y"}, {"Out"}}},
{G_OP_TYPE_POOL2D, {{"X"}, {"Out"}}}, {G_OP_TYPE_POOL2D, {{"X"}, {"Out"}}},
......
...@@ -44,7 +44,12 @@ void Loader<Dtype, P>::InitMemoryFromProgram( ...@@ -44,7 +44,12 @@ void Loader<Dtype, P>::InitMemoryFromProgram(
} else { } else {
auto dim = var_desc->Tensor_desc().Dims(); auto dim = var_desc->Tensor_desc().Dims();
PADDLE_MOBILE_ENFORCE(dim.size() > 0, "dim size is 0"); PADDLE_MOBILE_ENFORCE(dim.size() > 0, "dim size is 0");
dim[0] = 1; // dim[0] = 1;
for (auto &d : dim) {
if (d < 0) {
d *= -1;
}
}
auto tensor = var->GetMutable<LoDTensor>(); auto tensor = var->GetMutable<LoDTensor>();
tensor->Resize(make_ddim(dim)); tensor->Resize(make_ddim(dim));
} }
......
...@@ -1338,23 +1338,23 @@ class Reshape2Param : public OpParam { ...@@ -1338,23 +1338,23 @@ class Reshape2Param : public OpParam {
} }
} }
const RType *InputX() const { return input_x_; } const GType *InputX() const { return input_x_; }
const RType *InputShape() const { return input_shape_; } const GType *InputShape() const { return input_shape_; }
RType *Out() const { return out_; } GType *Out() const { return out_; }
RType *OutputXShape() const { return output_xshape_; } GType *OutputXShape() const { return output_xshape_; }
const vector<int> &Shape() const { return shape_; } const vector<int> &Shape() const { return shape_; }
const bool &Inplace() const { return inplace_; } const bool &Inplace() const { return inplace_; }
private: private:
RType *input_x_; GType *input_x_;
RType *input_shape_; GType *input_shape_;
RType *out_; GType *out_;
RType *output_xshape_; GType *output_xshape_;
vector<int> shape_; vector<int> shape_;
bool inplace_; bool inplace_;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册