Skip to content

Conversation

@NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Feb 15, 2023

We missed it before

cc @vfdev-5 @bjuncek @pmeier

Comment on lines +45 to +46
def _extract_params_for_v1_transform(self) -> Dict[str, Any]:
return {"transforms": self.transforms, "p": self.p}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why, but the transforms key was missing when using _extract_params_for_v1_transform() from the base class.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nn.Module overwrites __setattr__. One of the things it is doing is to not assign other nn.Module's into self.__dict__, but rather into self._modules. Since we only go through self.__dict__, we don't pick up self.transforms since isinstance(nn.ModuleList(...), nn.Module).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, good catch! thanks for the explanation

@NicolasHug NicolasHug requested a review from pmeier February 15, 2023 14:10
Copy link
Contributor

@pmeier pmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nicolas!

@NicolasHug NicolasHug merged commit 3080082 into pytorch:main Feb 15, 2023
@github-actions
Copy link

Hey @NicolasHug!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

@NicolasHug NicolasHug mentioned this pull request Feb 15, 2023
49 tasks
facebook-github-bot pushed a commit that referenced this pull request Mar 28, 2023
Reviewed By: vmoens

Differential Revision: D44416608

fbshipit-source-id: 1e8afbc880dacacacbd2f3e543d21cb4b90e5fdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants