Mr-Neutr0n 7bc152ff35 Fix incorrect frame padding formula in lora trainers
The ncopy calculation used `latent.shape[2] % patch_size_t` which
computes the remainder rather than the number of frames needed to
reach alignment. For example, with shape[2]=13 and patch_size_t=4,
this gives ncopy=1, resulting in 14 frames which is still not
divisible by 4, causing the assertion to fail.

The correct formula is `(patch_size_t - latent.shape[2] % patch_size_t) % patch_size_t`
which computes how many frames must be prepended to reach the next
multiple of patch_size_t. The outer modulo handles the already-aligned
case (returns 0 instead of patch_size_t).

Fixes #782
2026-02-11 19:35:55 +05:30
..
2025-01-12 19:27:21 +08:00
2025-01-12 19:27:21 +08:00
2025-03-22 15:14:06 +08:00