Skip to content

Commit

Permalink
Merge pull request #397 from IBM/fix/pad
Browse files Browse the repository at this point in the history
fix padding
  • Loading branch information
blumenstiel authored Feb 11, 2025
2 parents 32e67fb + 450c0b8 commit 3c3d59d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion terratorch/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pad_images(imgs: Tensor, patch_size: int | list, padding: str) -> Tensor:
f"but no multi-temporal data provided (data shape = {imgs.shape}).")

h, w = imgs.shape[-2:]
t = imgs.shape[-3:] if len(imgs.shape) > 4 else 1
t = imgs.shape[-3] if len(imgs.shape) > 4 else 1
t_pad, h_pad, w_pad = (p_t - t % p_t) % p_t, (p_h - h % p_h) % p_h, (p_w - w % p_w) % p_w
if t_pad > 0:
# Multi-temporal padding
Expand Down

0 comments on commit 3c3d59d

Please sign in to comment.