未验证 提交 d2b70c3c 编写于 作者: S Santa An 提交者: GitHub

[LITE][BM] Fix priorbox issue,test=develop (#4087)

上级 73ce5e62
...@@ -218,10 +218,10 @@ int DensityPriorBoxConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -218,10 +218,10 @@ int DensityPriorBoxConverter(void* ctx, OpLite* op, KernelBase* kernel) {
i_split_shape_data[1] /= 2; i_split_shape_data[1] /= 2;
shape[0] = &i_split_shape_data[0]; shape[0] = &i_split_shape_data[0];
shape[1] = &i_split_shape_data[0]; shape[1] = &i_split_shape_data[0];
name[0] = static_cast<const char*>( auto boxes_name = lite::subgraph::bm::UniqueName("bm_boxes");
lite::subgraph::bm::UniqueName("bm_boxes").c_str()); auto var_name = lite::subgraph::bm::UniqueName("bm_var");
name[1] = static_cast<const char*>( name[0] = static_cast<const char*>(boxes_name.c_str());
lite::subgraph::bm::UniqueName("bm_boxes_var").c_str()); name[1] = static_cast<const char*>(var_name.c_str());
int split_size[2]; int split_size[2];
split_size[0] = shape[0][1]; split_size[0] = shape[0][1];
split_size[1] = shape[1][1]; split_size[1] = shape[1][1];
......
...@@ -242,6 +242,7 @@ int PriorBoxConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -242,6 +242,7 @@ int PriorBoxConverter(void* ctx, OpLite* op, KernelBase* kernel) {
if (op_info->HasAttr("prior_num")) { if (op_info->HasAttr("prior_num")) {
param.prior_num = op_info->GetAttr<int32_t>("prior_num"); param.prior_num = op_info->GetAttr<int32_t>("prior_num");
} }
param.min_max_aspect_ratios_order = false;
if (op_info->HasAttr("min_max_aspect_ratios_order")) { if (op_info->HasAttr("min_max_aspect_ratios_order")) {
param.min_max_aspect_ratios_order = param.min_max_aspect_ratios_order =
op_info->GetAttr<bool>("min_max_aspect_ratios_order"); op_info->GetAttr<bool>("min_max_aspect_ratios_order");
...@@ -289,10 +290,10 @@ int PriorBoxConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -289,10 +290,10 @@ int PriorBoxConverter(void* ctx, OpLite* op, KernelBase* kernel) {
i_split_shape_data[1] /= 2; i_split_shape_data[1] /= 2;
shape[0] = &i_split_shape_data[0]; shape[0] = &i_split_shape_data[0];
shape[1] = &i_split_shape_data[0]; shape[1] = &i_split_shape_data[0];
name[0] = static_cast<const char*>( auto boxes_name = lite::subgraph::bm::UniqueName("bm_boxes");
lite::subgraph::bm::UniqueName("bm_boxes").c_str()); auto var_name = lite::subgraph::bm::UniqueName("bm_var");
name[1] = static_cast<const char*>( name[0] = static_cast<const char*>(boxes_name.c_str());
lite::subgraph::bm::UniqueName("bm_boxes_var").c_str()); name[1] = static_cast<const char*>(var_name.c_str());
int split_size[2]; int split_size[2];
split_size[0] = shape[0][1]; split_size[0] = shape[0][1];
split_size[1] = shape[1][1]; split_size[1] = shape[1][1];
......
...@@ -58,9 +58,7 @@ int SliceConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -58,9 +58,7 @@ int SliceConverter(void* ctx, OpLite* op, KernelBase* kernel) {
} }
for (size_t i = 0; i < axes.size(); i++) { for (size_t i = 0; i < axes.size(); i++) {
begin_index[axes[i]] = starts[i]; begin_index[axes[i]] = starts[i];
end_index[axes[i]] = ends[i] > static_cast<int32_t>(input_dims.size()) end_index[axes[i]] = ends[i];
? static_cast<int32_t>(input_dims.size())
: ends[i];
begin_mask &= ~(1 << axes[i]); begin_mask &= ~(1 << axes[i]);
end_mask &= ~(1 << axes[i]); end_mask &= ~(1 << axes[i]);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册