nemo_gym.data.task_selection
nemo_gym.data.task_selection
Select input rows by the task id each row carries.
Module Contents
Functions
API
The row as canonical JSON without Gym’s per-rollout bookkeeping (_ng_*), which differs between repeats.
The id a row carries itself: a materialized row’s TaskId, else its first of TASK_ID_FIELDS.
Indices of the rows to run: the first row of each selected task, in input order.
Each task is returned once even when the input repeats its row, so the caller’s repeat count alone decides the number of samples. Rows are selected only by an id stored in the row, never by position. Every row must carry an id; only the selected tasks’ rows must agree with each other, so a caller that selects one task per call does not re-check the whole input each time.
For example, a collated input that already repeats each task four times (a, a, a, a, b, b, b, b)
with task_ids=["a"] gives one index, [0]. Run with num_repeats=2, that is two rollouts
of a, not eight.