Skip to content

patch_grid_size computation in PatchEmbed #9

Open

Description

@ghaeflig

Hi,

Congrats for your really interesting work. By adapting the code for my data, I noticed that in the PatchEmbed class the patch_grid_size attribute does not take the stride into account. Is that normal ? I was thinking patch_grid would rather be like this:
patch_grid_size = (
(image_HW[0] - patch_HW[0]) // stride_HW[0] + 1,
(image_HW[1] - patch_HW[1]) // stride_HW[1] + 1,
)

By the way, if stride = patch_size it gives the same result and if it is not the case, num_patches is used only for pos_embedding that can be interpolated. So, it is not very important.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions