fastvideo.v1.dataset.utils
#
Module Contents#
Functions#
Get the latents and prompts from a row dictionary. |
|
Pad or crop an embedding [L, D] to exactly padding_length tokens. Return: |
API#
- fastvideo.v1.dataset.utils.collate_latents_embs_masks(batch_to_process, text_padding_length, keys) tuple[torch.Tensor, torch.Tensor, torch.Tensor, List[str]] [source]#
- fastvideo.v1.dataset.utils.get_torch_tensors_from_row_dict(row_dict, keys) Dict[str, Any] [source]#
Get the latents and prompts from a row dictionary.
- fastvideo.v1.dataset.utils.pad(t: torch.Tensor, padding_length: int) torch.Tensor [source]#
Pad or crop an embedding [L, D] to exactly padding_length tokens. Return:
[L, D] tensor in pinned CPU memory
[L] attention mask in pinned CPU memory