diff --git a/paddle/fluid/operators/hierarchical_sigmoid_op.h b/paddle/fluid/operators/hierarchical_sigmoid_op.h index 35a1de3e1917f704727ac6e65b02d37e5bbc94c4..418fe86f69fff392f103f53a98cd5d59038ee7bf 100644 --- a/paddle/fluid/operators/hierarchical_sigmoid_op.h +++ b/paddle/fluid/operators/hierarchical_sigmoid_op.h @@ -43,9 +43,7 @@ std::vector cal_rows(const framework::LoDTensor* path) { } } } - for (std::set::iterator it = tmp.begin(); it != tmp.end(); ++it) { - rows.push_back(*it); - } + rows.assign(tmp.begin(), tmp.end()); return rows; }