Skip to content

Commit

Permalink
fix bug : rpn anchor elem_size error (#493)
Browse files Browse the repository at this point in the history
Co-authored-by: qwang <[email protected]>
  • Loading branch information
clovking and qwang authored Dec 5, 2020
1 parent d8a27de commit d04481f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/op/rpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ void generate_anchors(const int base_size, const struct vector* ratios_, const s
base_anchor.x1 = base_size - 1.f;
base_anchor.y1 = base_size - 1.f;

struct vector* ratio_anchors = create_vector(sizeof(struct Anchor_t*) * 2, NULL);
struct vector* ratio_anchors = create_vector(sizeof(struct Anchor), NULL);

ratio_enum(base_anchor, ratios_, ratio_anchors);
for (int i = 0; i < ( int )ratio_anchors->elem_num; ++i)
{
struct vector* scale_anchors = create_vector(sizeof(struct Anchor_t*) * 2, NULL);
struct vector* scale_anchors = create_vector(sizeof(struct Anchor), NULL);

scale_enum(*( Anchor_t* )get_vector_data(ratio_anchors, i), scales_, scale_anchors);
for (int j = 0; j < scale_anchors->elem_num; j++)
Expand All @@ -120,7 +120,7 @@ static int infer_shape(struct ir_node* node)
struct ir_tensor* output = get_ir_graph_tensor(ir_graph, node->output_tensors[0]);
rpn_param_t* rpn_param = ( rpn_param_t* )node->op.param_mem;

rpn_param->anchors_ = create_vector(sizeof(struct Anchor_t*) * 2, NULL);
rpn_param->anchors_ = create_vector(sizeof(struct Anchor), NULL);
generate_anchors(rpn_param->basesize, rpn_param->ratios, rpn_param->anchor_scales, rpn_param->anchors_);

int dims[4];
Expand Down

0 comments on commit d04481f

Please sign in to comment.