modelzoo.transformers.pytorch.t5.input.utils.flat_map#

modelzoo.transformers.pytorch.t5.input.utils.flat_map(fn, dataset)[source]#

Map a function over an iterator and flatten the result.

Parameters
  • fn (callable) – The function to apply to each element.

  • dataset (iterator) – A stream of elements to map fn over.

Yields

A flattened version of fn applied to each element of dataset.