Remove permute bug: rely on F.conv3d spatial padding

This commit is contained in:
Daniel Maddern 2026-08-19 21:33:08 +07:00
parent 6fc7cf0ad6
commit f7c48b067a

View file

@ -55,9 +55,6 @@ def _causal_conv3d(x, weight, bias, *, kernel_size, stride, spatial_padding):
# if x.shape[2] == 1: return super().forward(x, autopad="causal_zero")
# x = F.pad(x, (0, 0, 0, 0, (k-1), 0), mode="constant") -- temporal
# return super().forward(x)
if spatial_padding > 0:
x = F.pad(x, (spatial_padding, spatial_padding, spatial_padding, spatial_padding, 0, 0), mode="reflect")
x = x.permute(0, 2, 1, 3, 4)
if x.shape[2] == 1:
# Keyframe path (matches reference's `autopad="causal_zero"`): truncate
# the temporal taps to the center 1 and run as an effective 2D conv.