dgs.utils.state

Definitions and helpers for a state.

Contains the custom collate functions to combine a list of States into a single one, keeping custom tensor subtypes intact.

Module Functions

collate_bboxes(batch, *_args, **_kwargs)

Collate a batch of bounding boxes into a single one.

collate_devices(batch, *_args, **_kwargs)

Collate a batch of devices into a single device.

collate_list_of_history(batch)

Collate function used to combine the data returned in the format of a class:ImageHistoryDataset.

collate_lists(batch)

Collate function used to not concatenate a batch of States.

collate_states(batch)

Collate function for multiple States, to flatten / squeeze the shapes and keep the tv_tensors classes.

collate_tensors(batch, *_args, **_kwargs)

Collate a batch of tensors into a single one.

collate_tvt_tensors(batch, *_args, **_kwargs)

Collate a batch of tv_tensors into a batched version of it.

get_ds_data_getter(attribute)

Given a single name of an attribute or property, return a function, that gets the respective values from a given State.

get_ds_data_getters(attributes)

Given a list of attribute names, return a function, that gets those attributes from a given State.

Module Classes

State(*args, bbox[, validate])

Class for storing one or multiple samples of data as a 'State'.