Fix Downsample3D spatial reflect pad to (W,H) dims only
This commit is contained in:
parent
136297f4ae
commit
b557cba173
1 changed files with 3 additions and 1 deletions
|
|
@ -93,7 +93,9 @@ def _resnet(x, p):
|
|||
|
||||
def _downsample(x, p):
|
||||
if p["space"] == 2:
|
||||
x = F.pad(x, (0, 1, 0, 1, 0, 0), mode="reflect")
|
||||
# Reference Downsample3D pads H and W by +1 reflect before the conv.
|
||||
# F.pad for 5D (B,C,T,H,W) uses (W_l, W_r, H_l, H_r, T_l, T_r).
|
||||
x = F.pad(x, (1, 1, 1, 1, 0, 0), mode="reflect")
|
||||
return _causal_conv3d(x, p["w"], p["b"], kernel_size=3, stride=(p["time"], p["space"], p["space"]), spatial_padding=0)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue