Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
Avihu Dekel committed Jan 22, 2023
1 parent 0b8846c commit 6ca2fe4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuse/dl/models/backbones/backbone_vit.py
Expand Up @@ -30,6 +30,9 @@ def __init__(
assert len(image_shape) == len(patch_shape), "patch and image must have identical dimensions"
np_image_shape = np.array(image_shape)
np_patch_shape = np.array(patch_shape)

# when shapes not divisable and strict=False, handaling is similar to pytorch strided convolution
# see here: https://pytorch.org/docs/stable/generated/torch.nn.Conv1d.html#torch.nn.Conv1d
if strict:
assert (np_image_shape % np_patch_shape == 0).all(), "Image dimensions must be divisible by the patch size."
self.num_tokens = int(np.prod(np_image_shape // np_patch_shape))
Expand Down

0 comments on commit 6ca2fe4

Please sign in to comment.