Skip to content

Confusing cls_token handling in ViTTransfomer::forward #3824

@syboomsy

Description

@syboomsy

image

I am quite confused when reading the code of forwarding function.
At line 421, why remove the class token given self.with_cls_token is True?
If it is correct, then at line 412, why remove the class token, given self.with_cls_token is False?
For the same flag var with_cls_token , decoder logic contradicts with encoder logic, could anyone explain this?

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