Skip to content

dew.decision.task

Decide: a decision model answering requests, in Dew’s types and in Jev’s wire form.

NameSummary
TASK_FILEThe file Decide.save writes into a run: its calibration, budget and name.
BudgetHow much one forward pass may hold: at most tokens tokens in at most rows windows.
KnockoutLaya’s tournament rule (predict_tournament): the options cut into near-equal groups of at most group, each group’s winner going on, round after round, until one group is left to answer the question; the answer’s probabilities cover that last round’s options alone.
FinalistsA released engine’s knock-out (StartLuxLabs/StartLux-Decision a99977d93, startlux_decide’s pipeline and readout, its wide_choice defaults): a choice of more than final options is cut into near-equal consecutive groups of at most group, the first ones one longer, each read once; the keep best of each group, in group order, are its finalists, the final best of them by that round where more qualify; the final round reads them, and the answer covers every option, the finalists sharing 1 - residual as the final gave it them and the others residual in proportion to their group round’s probabilities.
LAYA_ROUNDSLaya’s rounds, a tournament’s by default.
WeightsThe checkpoint a task’s weights came from: its step, and whether they are the run’s average.
PassShapeThe shape of one scoring pass (Decide.pass_shapes): rows windows of length tokens, each holding whole rows packed first-fit as a run’s windows hold them (Decide.packing), its questions in questions slots (a run’s window’s, DecisionObjective.bounds) of options options each (the budget’s, None where it declares none: each pass’s own, rounded up to a power of two).
UsageWhat a request cost: the tokens every question row read, how much of the state the rows kept, the smallest share any question kept, and each cut by what it cut, the rows it shortened and the tokens it removed, as training counts a row’s cuts (cut_counts).
usage_ofWhat a request’s rows cost: their tokens, the state’s, the least of it any row kept, and each cut’s rows and tokens.
DecideSettingsWhat a decision run records beside its backbone, and its task is built with (Decide.from_run): the head’s record (Head.record), the layout (by import path, its segments with it), the special tokens, the text tokenizer’s name, and an image processor’s source, or None.
CALIBRATIONSThe directory of a run beside its steps that holds each calibration Decide.save wrote, one file a set of weights it was fitted on (_fitted_file), so a reader pinned to a step reads the one fitted on it after a later one was fitted (row 3865).
step_calibrationsThe calibrations the run in directory keeps fitted on step’s weights, live and averaged, each file that exists: what a read of that step loads beside its latest (Decide.from_saved), which an export of the step is a function of (dew.interop.saved_sources).
DecideAnswers typed questions about a state, with one forward pass per batch.
EXTENSIONSThe request fields Decide.systemone reads beyond Jev’s, which strict drops.
PassPlanA pass growing a row at a time (Decide.planned): each length a pass may take (pass_shapes) keeps its first-fit placement of the rows so far over its most windows, so a row is placed once at each length rather than every row replayed for each one more (ledger 2424).
PassTokensWhat padding costs a served task’s passes (_DecideScoring.forward), per pass shape: the windows its passes computed, each length tokens, their rows’ real tokens among them and the passes.
RowScoringA Decide task’s laid-out text rows as a scoring task (dew.inference.scoring.Scoring): each request one row (Decide._encoded), answered by its raw [Q, K] logits, the passes a server of Jev bodies runs (Decide.logits).
WireScoringA Decide task as a scoring task of Jev request bodies (dew.inference.scoring.Scoring), answering each as Decide.systemone does under details, strict and whole.
trained_treeA task’s weights as a run trains them, the model’s own tree: the backbone’s projections, packed to serve (_served), split back (unpacked, ledger 2299), so a run trains, and its resume builds, one tree wherever it runs: a trunk held frozen splits back frozen (ledger 2439).
decoded_imagesThe images of a request’s images field, None or a list of PIL images, encoded image bytes, or base64 strings, bare or as data: URLs.
laid_outThe DecisionInputs of a batch of packed windows (PackedRows), each holding at most max_segments rows, the questions’ spans in each row’s context where spans_in_context (JointLayout.spans_in_context), each row’s block the whole row where whole_blocks (whole_blocks_of), its rows read in their streams as their layout’s attention says (Layout.attention).
whole_blocks_ofWhether layout’s rows are each one block of the whole row (QuestionLayout.split ‘whole’).

attribute source

TASK_FILE = 'decide.json'

The file Decide.save writes into a run: its calibration, budget and name.

dataclass source

class Budget(tokens: int = 16384, rows: int = 256, options: int | None = None)

How much one forward pass may hold: at most tokens tokens in at most rows windows.

Laya’s predict_items uses 16384 and 256. A pass packs its rows into a few windows of one of a few lengths, declared once (Decide.pass_shapes), each window’s question slots its bounds’ (Layout.bounds), and its options to options where it is declared, so every pass shares one of a few programs, compiled up front (Decide.compile_scoring).

options: int | None

The options every question of a pass pads to, the run’s widest (training’s own static width); None rounds each pass’s widest up to a power of two, a program for each, compiled as it comes. A request of more widens its pass, compiling it.

dataclass source

class Knockout(group: int = 16)

Laya’s tournament rule (predict_tournament): the options cut into near-equal groups of at most group, each group’s winner going on, round after round, until one group is left to answer the question; the answer’s probabilities cover that last round’s options alone.

dataclass source

class Finalists(
group: int = 25,
keep: int = 3,
final: int = 26,
residual: float = 0.001,
)

A released engine’s knock-out (StartLuxLabs/StartLux-Decision a99977d93, startlux_decide’s pipeline and readout, its wide_choice defaults): a choice of more than final options is cut into near-equal consecutive groups of at most group, the first ones one longer, each read once; the keep best of each group, in group order, are its finalists, the final best of them by that round where more qualify; the final round reads them, and the answer covers every option, the finalists sharing 1 - residual as the final gave it them and the others residual in proportion to their group round’s probabilities.

attribute source

LAYA_ROUNDS = Knockout()

Laya’s rounds, a tournament’s by default.

dataclass source

class Weights(step: int, ema: bool, averaged: tuple[tuple[str, int, bool], ...] = ())

The checkpoint a task’s weights came from: its step, and whether they are the run’s average.

A calibration is fitted to one set of weights, so save records them and from_run loads a saved calibration only for them.

averaged: tuple[tuple[str, int, bool], ...]

The runs’ checkpoints these weights are the fp32 mean of (Decide.averaged): each run’s directory, step, and whether its own average was read; none for one run’s weights.

dataclass source

class PassShape(length: int, rows: int, questions: int | None, options: int | None)

The shape of one scoring pass (Decide.pass_shapes): rows windows of length tokens, each holding whole rows packed first-fit as a run’s windows hold them (Decide.packing), its questions in questions slots (a run’s window’s, DecisionObjective.bounds) of options options each (the budget’s, None where it declares none: each pass’s own, rounded up to a power of two).

dataclass source

class Usage(
input_tokens: int,
state_tokens: int,
state_kept: int,
cut: Mapping[str, tuple[int, int]] = dict(),
)

What a request cost: the tokens every question row read, how much of the state the rows kept, the smallest share any question kept, and each cut by what it cut, the rows it shortened and the tokens it removed, as training counts a row’s cuts (cut_counts).

trimmed: bool

Whether a row’s declared budgets cut a question’s instructions or options.

function source

def usage_of(rows: Sequence[Encoded]) -> Usage

What a request’s rows cost: their tokens, the state’s, the least of it any row kept, and each cut’s rows and tokens.

dataclass source

class DecideSettings(
head: Mapping[str, object],
layout: Layout,
specials: Specials,
tokenizer: str | None,
processor: SourceReference | None,
context_encoder: ContextEncoder = 'table',
questions: int | None = None,
options: int | None = None,
)

What a decision run records beside its backbone, and its task is built with (Decide.from_run): the head’s record (Head.record), the layout (by import path, its segments with it), the special tokens, the text tokenizer’s name, and an image processor’s source, or None.

layout: Layout

The rows’ layout, which the run builds of its budgets (DecisionRunConfig.max_len, …), its head’s labels and its source’s attention.

context_encoder: ContextEncoder

How the model encodes a row’s context (DecisionModel.context_encoder); a run recorded before the choice existed embedded it by its token table.

questions: int | None

The most questions a row of the run’s data holds (Layout.row_questions), as the run recorded it; a pass’s question slots are its windows’ (Decide.pass_shapes), so no task reads it. None where the run recorded none, as before it did.

options: int | None

The most options a question of the run’s data lays out, a “none of the above” it adds included, which a pass of its task pads each question to (Budget.options); None as questions.

head: Mapping[str, object]

The head’s class record (Head.record), which Head.from_record builds over the backbone it reads, its one field the record leaves to the backbone: a record, not a value the settings build.

attribute source

CALIBRATIONS = 'calibrations'

The directory of a run beside its steps that holds each calibration Decide.save wrote, one file a set of weights it was fitted on (_fitted_file), so a reader pinned to a step reads the one fitted on it after a later one was fitted (row 3865).

function source

def step_calibrations(directory: str, step: int) -> tuple[epath.Path, ...]

The calibrations the run in directory keeps fitted on step’s weights, live and averaged, each file that exists: what a read of that step loads beside its latest (Decide.from_saved), which an export of the step is a function of (dew.interop.saved_sources).

dataclass source

class Decide(
model: DecisionModel,
variables: Variables,
layout: Layout,
tokenizer: Tokenizer,
specials: Specials,
calibration: Calibration = Calibration(),
confidence: Confidence = JevConfidence(),
budget: Budget = Budget(),
name: str = 'dew',
weights: Weights | None = None,
processor: Processor | None = None,
*,
precision: Numerics | None = None,
)

Answers typed questions about a state, with one forward pass per batch.

decide(state, questions) returns one answer per question, with its probabilities over exactly the question’s options, and decide(requests) each of many requests’ answers, scored together within the budget in a scoring server’s passes (RowScoring), tournament splits a choice too large for one pass into rounds, calibrated fits the calibration to held-out examples, and systemone takes and returns TypeSafe Jev’s wire format. The logits are divided by calibration’s temperatures, and each answer reports confidence’s statistic of its distribution.

weights: Weights | None

The run checkpoint the weights came from, when they came from a run.

processor: Processor | None

The backbone’s own processor, which prepares a request’s images for it.

name: str

The model name a Jev response reports.

pass_shapes: tuple[PassShape, ...]

The shapes a text pass packs its rows into, declared once: windows of the layout’s length and its halvings (dew.inference.tasks.length_ladder), each at a few window counts, one (a lone request’s pass), the powers of 8 below the most the budget’s tokens and rows allow, and that most; each window’s question slots a run’s window’s of that length (DecisionObjective.bounds), its options the budget’s (Budget). Where the budget declares its options, each shape is one program, which compile_scoring compiles.

context_length: int | None

The most context tokens a request carries (DecisionModel.context_length).

def from_pretrained(
name: str | Path = LAYA,
*,
subfolder: str | None = None,
revision: str | None = None,
dtype: str = 'float32',
param_dtype: str = 'float32',
attention_impl: AttentionImpl = 'auto',
trust: Sequence[str] = (),
) -> Self

Load a released Laya or joint-head checkpoint through Pretrained.load as a task.

trust names the sources whose own code the load may run (a backbone’s media processor’s), as dew.inference.load’s does (dew.registry.import_trusted).

A Laya task uses the temperatures that Laya’s agent reads from rl_agent_config.json; a joint-head release ships none. Either answers with Jev’s confidence; replace(task, confidence=...) selects Laya’s (EntropyConfidence) or the top probability (TopProbability).

def of(bundle: PretrainedDecision, *, name: str | None = None) -> Self

Build the declared decision task from a loaded composite bundle, without loading again. It answers under name, by default the Hub id the bundle resolved or else its directory.

def released(bundle: PretrainedDecision, *, name: str | None = None) -> Self

The declared decision task over the bundle’s own tree, its projections as the model holds them: what a run trains from a release (DecisionObjective), where of packs them to serve.

def default_step(directory: str) -> int | None

The step the run’s calibration (TASK_FILE) was fitted on where that is the step the run ranked best: a run that ended on its best step (restore_best) calibrates that step and loads it. Else its latest, which refuses a calibration fitted on another (calibration).

def step_records(directory: str, step: int) -> tuple[epath.Path, ...]

The calibrations the run in directory keeps fitted on step’s weights (step_calibrations), which a load of the step reads beside its latest.

def from_saved(
run: SavedRun,
*,
ema: bool | None = None,
mesh: MeshSpec | Mesh | None = None,
layout: Placement | None = None,
dtype: DTypeLike | None = None,
param_dtype: DTypeLike | None = None,
) -> Self

Load the DecisionObjective run run (its checkpoint pinned, SavedRun.pinned) as a task; from_run loads one from its directory.

The task is rebuilt from the run’s record over the checkpoint’s weights, and includes any calibration save wrote into the run. ema selects the averaged weights, and None uses them when the run kept them. mesh and layout place the weights as the trainer does, dtype overrides the compute dtype and param_dtype the storage dtype. The image processor reloads from its recorded source independently of the tokenizer that lays out the task’s text.

def averaged(
runs: Sequence[str],
*,
step: int | str | None = None,
ema: bool | None = None,
calibrate_on: Iterable[Example | Mapping[str, object]] | Reader | None = None,
) -> Self

The task over runs’ weights as any runs average (dew.checkpoints.averaged: their fp32 mean, each run’s at step, its latest where None, SavedRun.at, and ema as from_run reads them, a LoRA backbone’s factors merged first), its calibration the identity, or refit on calibrate_on’s held-out answers (calibrated): temperatures are fitted to one set of weights.

The runs are one task’s: their recorded settings (DecideSettings: head, layout, tokenizer, special tokens, processor and context encoder) the same; a run whose settings differ is refused (ValueError), naming them. The widths a pass pads to are no part of the weights: the average’s are the widest any run recorded, None where none recorded one. The task’s weights record each run’s directory, step and whether its average was read, so it is no one run’s: save writes it to a directory of its own as a run, which from_run and dew.pipeline then load, whatever its layout.

def save_pretrained(
directory: str | Path,
*,
max_shard_size: int | str = MAX_SHARD_SIZE,
) -> None

Write this task as a released checkpoint, which from_pretrained reads back.

A ModernBERT backbone under Laya’s head and layout is written in Laya’s layout (LayaCheckpoint.save), the files llama.cpp’s converter and /v1/systemone server read too. The calibration’s temperatures go with it, held within their bounds as this task applies them, so that a reader which does not hold them answers as this task does. A binning map or abstention thresholds, which that layout has no place for, are refused rather than dropped.

def save(directory: str) -> None

Write this task’s calibration, budget and name into the run directory.

It also records the checkpoint the weights came from, so from_run and dew.pipeline read the calibration back for that checkpoint. The file is written whole or not at all. An average of runs (averaged), whose weights no one run holds, is written to a directory of its own: a run of one checkpoint of the average, its optimizer state empty, under the record its runs share (DecisionObjective.inference_record), its model the base an adapter merged into, which from_run and dew.pipeline then read as any run’s, whatever its layout; a directory holding another run’s checkpoints is refused (ValueError).

def rows(
requests: Sequence[tuple[JSON, Mapping[str, Question]]],
*,
contexts: Sequence[JSON | None] | None = None,
) -> list[list[Encoded]]

Each request’s rows as a call scores them: its state and questions laid out, with its context (contexts, in order, or None for none) beside them.

def planned() -> PassPlan

An empty pass, which takes rows one at a time while they fit (PassPlan): what a server grows a pass by, each row placed once.

def packing(shape: PassShape, questions: int | None = None) -> Pack

How a pass of shape packs its rows: first-fit into its windows, each holding whole rows within a run’s bounds (DecisionObjective.bounds), as a run packs its rows (dew.decision.rows.packing), their gold left out; with questions past the shape’s slots, a window’s questions widened to that many, for a row the bounds’ probes undercount (a program of its own).

def compile_scoring(variables: Variables | None = None) -> tuple[PassShape, ...]

Compile every text pass’s program (pass_shapes) over variables (the task’s own by default), by one pass of the layout’s shortest row at each shape that holds it, so a scorer compiles none while it serves; returns the shapes compiled. Each pass runs on the calling thread, under every context its caller holds (a mesh, JAX’s and Dew’s own thread-local settings), which the program its serving calls read is keyed by: a worker thread holds none of them. Where the budget declares no options (Budget), a pass’s own decide its program, which it compiles as it comes, and none is compiled here.

def logits(rows: Sequence[Encoded]) -> list[np.ndarray]

Return each row’s raw [Q, K] logits, one row per question laid out in it, in slot order.

The rows are scored shortest first, in the passes a server of this task runs and over its programs (RowScoring, dew.inference.scoring.ScoringServer), one path for a call and a server alike.

def scored(
rows: Sequence[Encoded],
variables: Variables | None = None,
) -> list[np.ndarray]

Each of rows’ raw [Q, K] logits from one pass over them all, which a plan takes (planned), over variables (the task’s own by default).

def tournament(
state: JSON,
questions: Mapping[str, Question],
*,
rounds: Knockout | Finalists = LAYA_ROUNDS,
) -> dict[str, Answer]

Return answers in which every choice of more options than one pass reads is decided in rounds, by rounds’ rule: Laya’s knock-out (Knockout) or a released engine’s finalists (Finalists).

Each question plays its own rounds: one whose finalists fit a pass is not split again while the others play on, and waits for the final with its finalists unchanged.

def calibrated(
held_out: Iterable[Example | Mapping[str, object]] | Reader,
*,
binning: bool = False,
target_error: float | None = None,
type_minimum: int = TYPE_MINIMUM,
bucket_minimum: int = BUCKET_MINIMUM,
) -> Self

Return this task with temperatures fitted to held-out answers.

If asked, it also fits a binning map and abstention thresholds that keep the error of the accepted answers at target_error, as Calibration’s parts fit them. held_out is labelled examples, or a validation reader of decision rows already laid out (dew.data.compile.held(chain, objective=objective.data())). The minimum counts are Laya’s: a type’s temperature needs type_minimum answers and a bucket’s bucket_minimum.

def score(
examples: Iterable[Example | Mapping[str, object]],
metrics: Sequence[Metric] = (),
) -> dict[str, float]

Return metrics over the questions answered for examples, through this task’s temperatures.

This is a run’s validation pass (Evaluation.run) over those questions, each probability divided by its temperature; a binning map or abstention thresholds are not applied. The default metrics are Accuracy, ECE, AURC and the log loss. The pass agrees its result across a process pool, so there every process calls it. It scores on the mesh the task’s weights are placed on, its rows split over the mesh’s row axes as a run’s validation splits them, or on one local device for weights placed on none.

def gated(min_confidence: float | Mapping[str, float]) -> Self

Return this task abstaining below min_confidence.

min_confidence is one threshold for every answer, or one per calibration bucket (bucket), with the other buckets ungated. An answer abstains when its calibrated (and binned) top probability is below its threshold, as with Laya’s min_confidence.

def systemone(request, *, details=False, strict=False, whole=False)

Answer a Jev request body with a Jev response body, or a list of bodies with a list of responses, in order.

A list’s bodies are answered as each would be alone, their rows scored together within the budget (batch); a body Jev would refuse takes its refusal, the ValueError a lone body raises, in its place, and the others are answered all the same.

The request holds state and questions in Jev’s wire format, and optionally model, which this task ignores. The response holds model (this task’s name), one answer per question, and usage. A Noul’s answer is noul; a Choice’s is choice, probabilities and confidence; a Score’s is score, legend, probabilities and confidence. Numbers are rounded to four places. With details, a Noul also reports its confidence, an answer reports whether it abstained when the calibration gates, and usage reports how much of the state it kept.

Beyond Jev’s fields a request may carry images: a list of images, each a PIL image, encoded image bytes, or a base64 string, bare or as a data: URL. strict answers as Jev’s own endpoint does: the request’s extension fields are dropped and the response holds Jev’s fields alone.

With whole, a request that the layout could answer only by cutting its state, instructions or options is refused instead, naming the maximum context length, as a benchmark that forbids truncation requires (Decision Index counts such a refusal as unsupported).

def scoring(
*,
details: bool = False,
strict: bool = False,
whole: bool = False,
) -> tuple[WireScoring, Variables]

This task as a scoring task of Jev request bodies (dew.inference.scoring.Scoring), answering each as systemone does with these options, and the weights it scores with. The scoring task holds none of them: a server holds them resident and hands them to each pass, and swaps both whole on a reload (ScoringServer.reload), so an answer always pairs this task’s calibration with the weights it was fitted to.

attribute source

EXTENSIONS = ('images', 'context')

The request fields Decide.systemone reads beyond Jev’s, which strict drops.

class source

class PassPlan(decide: Decide)

A pass growing a row at a time (Decide.planned): each length a pass may take (pass_shapes) keeps its first-fit placement of the rows so far over its most windows, so a row is placed once at each length rather than every row replayed for each one more (ledger 2424). A length drops out when a row is longer than its windows or finds no room in them; first-fit opens a window only where those before it have no room, so no later row brings it back. The pass holds its rows while a length does. A row that asks more questions than a length’s windows hold widens them (Decide.packing), its rows placed again; a row refused ends the plan, which takes none after it.

def add(row: Encoded) -> bool

Take row into the pass where a length still holds every row so far and it; False where none does, which ends the plan.

def shape() -> PassShape

The pass’s shape: of the shortest length that holds its rows, the fewest windows declared that hold them.

def windows() -> list[int]

Each row’s window at the pass’s shape (shape).

dataclass source

class PassTokens(shapes: dict[PassShape, _Passes] = dict())

What padding costs a served task’s passes (_DecideScoring.forward), per pass shape: the windows its passes computed, each length tokens, their rows’ real tokens among them and the passes. metrics reads the share of each shape’s tokens, and of every pass’s, its rows held, as a run reads its own (train/real_token_share, row 2772).

def add(shape: PassShape, windows: int, rows: Sequence[Encoded]) -> None

Count a pass at shape over rows, computed in windows windows.

def metrics() -> dict[str, float]

served/real_token_share, of every pass’s tokens the share its rows held, and each shape’s under served/passes/<rows>x<length>/ beside its passes; none before a pass. Read from another thread than the engine’s that adds passes, it reads one moment’s shapes (a copy taken at once).

dataclass source

class RowScoring(decide: Decide, passes: PassTokens = PassTokens())

A Decide task’s laid-out text rows as a scoring task (dew.inference.scoring.Scoring): each request one row (Decide._encoded), answered by its raw [Q, K] logits, the passes a server of Jev bodies runs (Decide.logits).

def admit(request: Encoded) -> scoring.ScoringRequest[_Row, None]
def answer(payload: None, outputs: Sequence[np.ndarray]) -> np.ndarray

dataclass source

class WireScoring(
decide: Decide,
passes: PassTokens = PassTokens(),
details: bool = False,
strict: bool = False,
whole: bool = False,
counts: CorpusCounts = (lambda: CorpusCounts('served', 'served'))(),
counting: threading.Lock = threading.Lock(),
)

A Decide task as a scoring task of Jev request bodies (dew.inference.scoring.Scoring), answering each as Decide.systemone does under details, strict and whole.

admit parses and lays out a body, refusing what Jev would refuse, a body the layout could answer only by cutting it under whole included; answer reads a body’s answers off its rows’ logits.

counts: CorpusCounts

What the task admitted and refused, as a run’s data counters count its rows (CorpusCounts): each request it answers, cut short where any row’s state was, and each cut’s rows and tokens; each it refuses under its reason (Refused), unfit, options_alike, or cut under whole. A server reports them as a run reports its own (CorpusCounts.metrics, metrics).

counting: threading.Lock

Held while counts changes or is read, as requests are admitted on threads of their own.

def metrics() -> dict[str, float]

Its passes’ share of their tokens its rows held (PassTokens.metrics) and what it admitted and refused (counts, under data/.../served, one moment’s), as its server reports them (dew.inference.scoring.Metered).

def admit(request: Mapping[str, object]) -> scoring.ScoringRequest[_Row, _Admitted]
def answer(payload: _Admitted, outputs: Sequence[np.ndarray]) -> dict[str, JSON]

function source

def trained_tree(model: DecisionModel, variables: Variables) -> Variables

A task’s weights as a run trains them, the model’s own tree: the backbone’s projections, packed to serve (_served), split back (unpacked, ledger 2299), so a run trains, and its resume builds, one tree wherever it runs: a trunk held frozen splits back frozen (ledger 2439). A task that holds no weights (a scoring task’s, Decide.scoring) has none to split.

function source

def decoded_images(images: object) -> list[Image.Image]

The images of a request’s images field, None or a list of PIL images, encoded image bytes, or base64 strings, bare or as data: URLs.

function source

def laid_out(
batch: Mapping[str, object],
max_segments: int,
*,
spans_in_context: bool = False,
whole_blocks: bool = False,
attention: tuple[tuple[tuple[int, ...], ...], int] | None = None,
) -> DecisionInputs

The DecisionInputs of a batch of packed windows (PackedRows), each holding at most max_segments rows, the questions’ spans in each row’s context where spans_in_context (JointLayout.spans_in_context), each row’s block the whole row where whole_blocks (whole_blocks_of), its rows read in their streams as their layout’s attention says (Layout.attention).

function source

def whole_blocks_of(layout: Layout) -> bool

Whether layout’s rows are each one block of the whole row (QuestionLayout.split ‘whole’).