Shortcuts

flash.core.data.batch.default_uncollate

flash.core.data.batch.default_uncollate(batch)[source]

This function is used to uncollate a batch into samples. The following conditions are used:

  • if the batch is a dict, the result will be a list of dicts

  • if the batch is list-like, the result is guaranteed to be a list

Parameters

batch (Any) – The batch of outputs to be uncollated.

Return type

List[Any]

Returns

The uncollated list of predictions.

Raises
  • ValueError – If the input is a dict whose values are not all list-like.

  • ValueError – If the input is a dict whose values are not all the same length.

  • ValueError – If the input is not a dict or list-like.