xnn.common.models.registry.resolve_dispersion#

xnn.common.models.registry.resolve_dispersion(explicit, recorded)[source]#

The dispersion a deployment adds to a checkpoint’s model.

recorded is the checkpoint’s subtracted_dispersion record (what the labels had removed, with the settings to add it back); explicit is what the caller asked for. The rules: explicit=False serves the model as is; with no record the explicit request is used; with a record and no request the record is used; with both, the explicit keys override the recorded ones (so {"cutoff_triple": 8.0} keeps the recorded functional parameters), and a different term name is an error.

Returns:

The spec for add_dispersion(), or None to add nothing.

Return type:

dict, str, True or None

Raises:

ValueError – When the explicit spec names another term than the record.