未验证 提交 8b5ea414 编写于 作者: Z zhaoying9105 提交者: GitHub

flatten & reshape bug (#113)

1 flatten & reshape 之前没有放到 paddle_use_bridges 中,现在放进去;
2 reshape 中 cnmlCreateNdReshapeOpParam dim_num 之前误写成4,应该是 output_dims.size()
上级 12d8437e
...@@ -39,6 +39,10 @@ USE_SUBGRAPH_BRIDGE(layout, kMLU); ...@@ -39,6 +39,10 @@ USE_SUBGRAPH_BRIDGE(layout, kMLU);
USE_SUBGRAPH_BRIDGE(slice, kMLU); USE_SUBGRAPH_BRIDGE(slice, kMLU);
USE_SUBGRAPH_BRIDGE(squeeze, kMLU); USE_SUBGRAPH_BRIDGE(squeeze, kMLU);
USE_SUBGRAPH_BRIDGE(squeeze2, kMLU); USE_SUBGRAPH_BRIDGE(squeeze2, kMLU);
USE_SUBGRAPH_BRIDGE(flatten, kMLU);
USE_SUBGRAPH_BRIDGE(flatten2, kMLU);
USE_SUBGRAPH_BRIDGE(reshape, kMLU);
USE_SUBGRAPH_BRIDGE(reshape2, kMLU);
#ifdef LITE_BUILD_EXTRA #ifdef LITE_BUILD_EXTRA
USE_SUBGRAPH_BRIDGE(gather, kMLU); USE_SUBGRAPH_BRIDGE(gather, kMLU);
USE_SUBGRAPH_BRIDGE(lrn, kMLU) USE_SUBGRAPH_BRIDGE(lrn, kMLU)
......
...@@ -67,8 +67,8 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -67,8 +67,8 @@ int ReshapeConverter(void* ctx, OpLite* op, KernelBase* kernel) {
int cnml_trans2_input_shape[4]; int cnml_trans2_input_shape[4];
CNML_CALL( CNML_CALL(
cnmlGetTensorShape(trans2_input->mlu_tensor(), cnml_trans2_input_shape)); cnmlGetTensorShape(trans2_input->mlu_tensor(), cnml_trans2_input_shape));
CNML_CALL( CNML_CALL(cnmlCreateNdReshapeOpParam(
cnmlCreateNdReshapeOpParam(&reshape_param, cnml_trans2_input_shape, 4)); &reshape_param, cnml_trans2_input_shape, output_dims.size()));
// Use cnmlCreatexxxOpForward to create op. // Use cnmlCreatexxxOpForward to create op.
CNML_CALL(cnmlCreateReshapeOp(&reshape_op, CNML_CALL(cnmlCreateReshapeOp(&reshape_op,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册