Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Comments

make __getattr__ on Module return object, not Any#257

Merged
catwell merged 2 commits intomainfrom
pr/getattr-returns-object
Feb 6, 2024
Merged

make __getattr__ on Module return object, not Any#257
catwell merged 2 commits intomainfrom
pr/getattr-returns-object

Conversation

@catwell
Copy link
Member

@catwell catwell commented Feb 6, 2024

PyTorch chose to make it Any because they expect its users' code to be "highly dynamic": pytorch/pytorch#104321 It is not the case for us, in Refiners having untyped code goes contrary to one of our core principles.

Note that there is currently an open PR in PyTorch to return Module | Tensor, but in practice this is not always correct either: pytorch/pytorch#115074

I also moved Residuals-related code from SD1 to latent_diffusion because SDXL should not depend on SD1 and made Lora generic.

@catwell catwell requested a review from deltheil February 6, 2024 10:13
PyTorch chose to make it Any because they expect its users' code
to be "highly dynamic": pytorch/pytorch#104321

It is not the case for us, in Refiners having untyped code
goes contrary to one of our core principles.

Note that there is currently an open PR in PyTorch to
return `Module | Tensor`, but in practice this is not always
correct either: pytorch/pytorch#115074

I also moved Residuals-related code from SD1 to latent_diffusion
because SDXL should not depend on SD1.
@catwell catwell force-pushed the pr/getattr-returns-object branch from 60d5d0c to b1ad6f3 Compare February 6, 2024 10:19
@catwell catwell merged commit 37425fb into main Feb 6, 2024
@catwell catwell deleted the pr/getattr-returns-object branch February 9, 2024 08:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants