Skip to content

Commit

Permalink
add get to array_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmang committed Oct 13, 2023
1 parent 1e577d4 commit fdbe482
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vowpalwabbit/core/include/vw/core/array_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ class parameters
else { return dense_weights[i]; }
}

inline VW::weight& get(size_t i)
{
if (sparse) { return sparse_weights.get(i); }
else { return dense_weights.get(i); }
}

template <typename Lambda>
void set_default(Lambda&& default_func)
{
Expand Down

0 comments on commit fdbe482

Please sign in to comment.