# tinker.types.Datum *Generated from tinker 0.30.4 at commit [`1e5777e`](https://github.com/thinking-machines-lab/tinker/tree/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d). Source links point at that snapshot.* ## *class* [**tinker.types.Datum**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L43)() **Fields:** - [**model_input**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L44) (*[ModelInput](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/types/modelinput/index.md)*) - [**loss_fn_inputs**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L45) (*[LossFnInputs](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/_pydantic_types/datum.py#L13)*) - [**model_input_spans**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L47) (*Optional\[[ProvenanceSpans](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L39)\]*) – Provenance of the input tokens as assembled: consecutive runs tiling `model_input` (lengths sum to its token length; position comes from order). Attach via `with_provenance`. - [**loss_fn_input_spans**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L52) (*Optional\[[ProvenanceSpans](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L39)\]*) – Attribution of the loss rows: consecutive runs tiling `loss_fn_inputs["target_tokens"]` (lengths sum to its length). Attach via `with_provenance`. ### [**with_provenance**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L68)(*model_input*, *loss_fn_inputs*) Return a copy carrying provenance for both span-annotated fields. Each keyword names the Datum field whose positions its runs tile — `model_input` spans tile the input tokens, `loss_fn_inputs` spans tile `loss_fn_inputs["target_tokens"]`. Tiling is validated here, so a miscounted partition fails at the call site rather than as a request error. **Parameters:** - [**model_input**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L70) (*[ProvenanceSpans](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L39)*) - [**loss_fn_inputs**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L71) (*[ProvenanceSpans](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/datum.py#L39)*) **Returns:** *Self* ## Referenced by - [tinker_cookbook.rl.assemble_training_data](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/assemble_training_data/index.md) - [tinker_cookbook.rl.trajectory_to_data](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/trajectory_to_data/index.md) - [tinker_cookbook.supervised.StreamingSupervisedDatasetFromHFDataset.get_batch](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/streamingsuperviseddatasetfromhfdataset/#streamingsuperviseddatasetfromhfdataset-get_batch) - [tinker_cookbook.supervised.SupervisedDataset.get_batch](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/superviseddataset/#superviseddataset-get_batch) - [tinker_cookbook.supervised.SupervisedDatasetFromHFDataset.get_batch](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/superviseddatasetfromhfdataset/#superviseddatasetfromhfdataset-get_batch) - [TrainingClient.forward](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/trainingclient/#forward) - [TrainingClient.forward_backward](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/trainingclient/#forward_backward) - [TrainingClient.forward_backward_custom](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/trainingclient/#forward_backward_custom)