espnet2.train.collate_fn.MappingCollateFn
Less than 1 minute
espnet2.train.collate_fn.MappingCollateFn
class espnet2.train.collate_fn.MappingCollateFn(fields: Dict[str, List[str]], float_pad_value: float | int = 0.0, mapping_pad_value: float | int = -10000000000.0, int_pad_value: int = -32768, not_sequence: Collection[str] = ())
Bases: CommonCollateFn
Collate named numeric annotation mappings alongside sequence inputs.
fields maps each structured input name to its ordered scalar label keys. Missing keys use mapping_pad_value. Strings require task-specific tokenization before collation; arbitrary nested objects are not tensorized.
